Can any one please tell me how I can remove the slash from the end of a variable
In my index.php I have the following:
$url=$_SERVER['REQUEST_URI'];
include_once "sites/$url.php";
My problem is if I write example.com/test/somefile/
nothing comes but if I write example.com/test/somefile
it works
So is there a way to remove the slash if the variable ends with a slash?