how to replace slashes from beginning and end?
So for example, all of these:
/this/that/
/this/that
this/that/
////////this/that////////////
... become: this/that
how to replace slashes from beginning and end?
So for example, all of these:
/this/that/
/this/that
this/that/
////////this/that////////////
... become: this/that
$txt = '////////this/that////////////';
echo rtrim(ltrim($txt, '/'), '/');
Result:
this/that