How can I remove the "/" from the result of the following code:
$url = $_SERVER['PHP_SELF']; $section = dirname ($url); print ("$section");
thanks, peter
this should work
$section = ereg_replace("/?", "", $url); //remove first slash
Use str_replace instead of REGEX here.
$section = str_replace ("/","",$section);