troubleshooting Question

basename($_SERVER["PHP_SELF"]) to include the quesry string

Avatar of jblayney
jblayneyFlag for Canada asked on
PHP
17 Comments1 Solution2212 ViewsLast Modified:
Hello,

I am using this to get a file name..

$page = basename($_SERVER["PHP_SELF"]);
echo $page;

and it will return news.php which is great...

I need it to also include the query string like so...

news.php?id=1

Is there any way to do this? I cant find anything online...


Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 17 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros