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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/278302-stripping-folder-name-from-variable/#findComment-1431726 Share on other sites More sharing options...
Solution alanl1 Posted May 23, 2013 Author Solution Share Posted May 23, 2013 fantastic that worked thanks Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.