I want to remove \".php\" from the end of a string if it exists. Consider this:
$filename = \'index\'; rtrim($filename,\".php\");//returns \"index\" $filena
The second argument to rtrim is a string with a list of characters. In this case, it will strip off any P, H, and . in your string, so returning searc.
rtrim