alanl1 Posted May 23, 2013 Share Posted May 23, 2013 Hi professionals I am passing a variable through to a page and it shows the filename and folder $newname = $_GET['newname']; //The Uploads/ folder will need to be stripped here to retreive the filename...echo "the filename is " . $newname; $sql = "exec importSAR " . "'" . "$newname" . "'"; exec importSAR 'uploads/output.csv' I only want it to show the filename for my stored procedure so it says exec importSAR 'output.csv' can this be done, can the uploads/ part be removed thanks in advance Link to comment https://forums.phpfreaks.com/topic/278302-stripping-folder-name-from-variable/ Share on other sites More sharing options...
Barand Posted May 23, 2013 Share Posted May 23, 2013 basename Link to comment https://forums.phpfreaks.com/topic/278302-stripping-folder-name-from-variable/#findComment-1431726 Share on other sites More sharing options...
alanl1 Posted May 23, 2013 Author Share Posted May 23, 2013 fantastic that worked thanks Link to comment https://forums.phpfreaks.com/topic/278302-stripping-folder-name-from-variable/#findComment-1431728 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.