TecTao Posted July 28, 2009 Share Posted July 28, 2009 I'm using an upload application putting images in a directory and writing the image name to a database table. The image name uploaded includes the directory. An example would be upload/image1.jpg. Either on the upload or when I call the variable, I want to remove upload/ to show only the image file name. Any help or ideas? Thanks... Link to comment https://forums.phpfreaks.com/topic/167739-remove-some-text-from-variable/ Share on other sites More sharing options...
slapdashwebdesigner Posted July 28, 2009 Share Posted July 28, 2009 $file = "upload/image1.jpg"; $fileinfo = pathinfo($file); $file = $fileinfo['basename']; would set $file to image1.jpg Link to comment https://forums.phpfreaks.com/topic/167739-remove-some-text-from-variable/#findComment-884561 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.