Home ›
Remove a trailing slash (if any) from a string with PHPRemove a trailing slash (if any) from a string with PHP
Submitted by Benjamin Melançon on August 23, 2009 - 11:31am
php remove traling slash
php remove last character
http://us2.php.net/manual/en/function.rtrim.php
From a line in template.php that also takes out leading http:// to present a more human-friendly web address.
<?php
$display = rtrim(str_replace('http://', '', $url), " /");
?>