I\'m doing some url rewriting in PHP and need to find URLS with a slash at the end and then do a 301 redirect. I thought there\'d be a simple PHP function to find last stri
You could preg_replace() a / at the end of the subject
preg_replace()
/
$url = 'http://domainx.com/characters/'; $url = preg_replace('/(?:\/)$/', '', $url);