You put rtrim
in your question, why not just look it up?
$url = rtrim($url,"/");
As a side note, look up any PHP function by doing the following:
- http://php.net/functionname
- http://php.net/rtrim
- http://php.net/trim
(rtrim
stands for ‘Right trim’)