faintermann adlı üyeden alıntı: mesajı görüntüle
<?php

$uzanti = "thumbs/5/0/2/21972_2.jpg";

$uzantison = substr($uzanti,-6);

echo $uzantison;

?>
bu işini görebilir.
o _2.jpg kısmı _22.jpg ise almaz daha toleranslı bir örnek olarak şu kullanılabilir;

<?php
$uzanti = "thumbs/5/0/2/21972_2.jpg";

$uzantison = explode("_", $uzanti);
$uzantison = '_' . $uzantison[1];

echo $uzantison;
?>