...

View Full Version : remove all strings before '/'



shajiuddin
01-12-2012, 11:25 AM
Hi,

My one (1) varriable $string is return string like this 'fishes_photos/item_thumb_photo_9252Winter.jpg'


I need to remove all strings before '/' and also remove '/' like this 'item_thumb_photo_9252Winter.jpg'

I used str_replace() but unable to achieve my need please help me

Regards.

abduraooft
01-12-2012, 12:01 PM
$arr=explode($string,',');
echo end($arr);

kbluhm
01-12-2012, 12:21 PM
$file_name = basename( $string );

echo $file_name; // item_thumb_photo_9252Winter.jpg



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum