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!!!!!! Quote Link to comment 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'], "~./\\"); Quote Link to comment 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.