How Do I find the name of the page title from $_SERVER['php_self']?
Let's say the $_SERVER shows my page like this: /application/mysite/signup.php.
How can I select the page title signup?
You can use basename:
echo basename($_SERVER['php_self'], '.php');
or pathinfo:
$pathInfo = pathinfo($_SERVER['php_self']);
echo $pathInfo['filename'];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With