I have a string, a file path, something like
$string = "customer-service/tweep/cs/gsergsergrs/2017-20190Course-Schedule.pdf"
I want to replace all the characters before the backslash with 3 dashes, so that it returns:
$string = ---/---/---/---/2017-20190Course-Schedule.pdf
I have tried using this preg_replace pattern, but it returns ---/2017-20190Course-Schedule.pdf
preg_replace( "/(.+\/)+/", "---/", $string);
Any way to run the replace on every instance of the pattern matching?