I want to replace any occurences of / ./ or ../ at the begining of a string with nothing, could be multiple ../../../, but I don't want to trim any slashes once the non . or / text starts.
Is there any easy way to do this without regex?
this is what I'm thinking:
$new_string = preg_replace('[.|/]*[.|/]', '', $to_search);
I'm not sure about the regex itself? What I'm trying to say is replace any . or / before anything that's not . or / within nothing ''
Thanks in advance.