We have a string that is constantly generating the following pattern below. Ideally we would like to get rid of the string (all characters) up to the first "/" found. I have tried the following but it is not working. Need assistance to see what i am missing.
The goal is to remove all characters before the first "/" and the "/" itself from the beginning. The tricky part is that the string before the first "/" can vary in length.
$patt = '/.+\/';
$repl = '';
$str = preg_replace($patt, $repl, $str);
Here's a method using the substr() and strpos() functions that will work:
$str = substr($str, strpos($str, '/') + 1 );