Reputation: 31
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
Upvotes: 3
Views: 173
Reputation: 382646
$txt = '////////this/that////////////';
echo rtrim(ltrim($txt, '/'), '/');
Result:
this/that
Upvotes: -1