networkthis Posted February 24, 2008 Share Posted February 24, 2008 I am a newbie and would like some advice on how to do the following... Need to trim all dots, slashes, and tildes (. / \ ~) from the beginnings and ends of the $_GET['path'] variable Here is the code if (isset($_POST['submitBtn'])){ $actpath = isset($_POST['path']) ? $_POST['path'] : '.'; } else { $actpath = isset($_GET['path']) ? $_GET['path'] : '.'; } Definetely curious what the best method would be..maybe an example... I have tried the trim method but I couldn't figure it out ???...Thank you in advance for all your help!!!!!! Link to comment https://forums.phpfreaks.com/topic/92753-need-help-trimming-a-function-yes-im-new-at-this/ Share on other sites More sharing options...
Bauer418 Posted February 24, 2008 Share Posted February 24, 2008 You'll want to specify the second parameter of the trim function, like this: $path = trim($_GET['path'], "~./\\"); Link to comment https://forums.phpfreaks.com/topic/92753-need-help-trimming-a-function-yes-im-new-at-this/#findComment-475206 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.