I want to get filename without any $_GET variable values from a URL in php?
$_GET
My URL is http://learner.com/learningphp.php?lid=1348
http://learner.com/learningphp.php?lid=1348
I
Use this function:
function getScriptName() { $filename = baseName($_SERVER['REQUEST_URI']); $ipos = strpos($filename, "?"); if ( !($ipos === false) ) $filename = substr($filename, 0, $ipos); return $filename; }