בבקשה :
PHP קוד:
$text ='http://www.google.co.il/images/logo_sm.gif/';
if (substr($text,strlen($text)-1) == '/')
{
$text = substr($text,0,(strlen($text)-1));
}
$type = substr($text,(strlen($text)-4));
echo "type is $type<br>";
אם שמתי לב טיפלתי באפשרות שהתו האחרון הוא / , לפעמים עושים את זה...