lingo5 Posted December 15, 2011 Share Posted December 15, 2011 Hi, I need to echo a file name excluding the full path. i.e.: if the path stored in my DB is '../uploads/none.jpg', I need to echo 'none.jpg' only. How can I do that?. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/253237-please-help-echoing-a-file-path/ Share on other sites More sharing options...
ManiacDan Posted December 15, 2011 Share Posted December 15, 2011 basename Quote Link to comment https://forums.phpfreaks.com/topic/253237-please-help-echoing-a-file-path/#findComment-1298146 Share on other sites More sharing options...
lingo5 Posted December 15, 2011 Author Share Posted December 15, 2011 Thanks that fixed it, this is how I've done it: $fullpath = $row_documentos_update_RS['documento_path']; $info = pathinfo($fullpath); $file_name = basename($fullpath,'.'.$info['']); Quote Link to comment https://forums.phpfreaks.com/topic/253237-please-help-echoing-a-file-path/#findComment-1298155 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.