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
Your URL:
$url = 'http://learner.com/learningphp.php?lid=1348'; $file_name = basename(parse_url($url, PHP_URL_PATH)); echo $file_name;
output: learningphp.php