Woodburn2006 Posted May 29, 2007 Share Posted May 29, 2007 if i have an image at the address: http://www.domain.com/images/picture.jpg how do i get it so that php splits it up and i am left with just picture.jpg? Quote Link to comment https://forums.phpfreaks.com/topic/53422-splitting-a-filename/ Share on other sites More sharing options...
kenrbnsn Posted May 29, 2007 Share Posted May 29, 2007 You probably want to use the function pathinfo() <?php $str = 'http://www.domain.com/images/picture.jpg'; $pi = pathinfo($str); echo $pi['basename']; ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/53422-splitting-a-filename/#findComment-263968 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.