I want to get filename without any $_GET variable values from a url in php?
My url is http://learner.com/learningphp.php?lid=1348
I only want to retrieve the learningphp.php
from the url?
How to do this? Please help.
I used basename but it gives all the variable values also- learntolearn.php?lid=1348
which are in the url.
Use this function:
Following steps shows total information about how to get file, file with extension, file without extension. This technique is very helpful for me. Hope it will be helpful to you too.
Use parse_url to extract the path from the URL, then pathinfo returns the filename from the path