Hello Readers if you getting in codition where you have to find the current file name then this blog is very helpful to you.
Suppose you are making user redirect only when he is in account.php then you just have to fine the file name.
<?php
if ($currentPage == 'account.php')
{
//do your code here..
}
?>
So get the file name you have to php syntax $_SERVER['PHP_SELF'], And the code will go like this:=
<?php
echo "My PHP file name is =". basename($_SERVER['PHP_SELF']);
?>
And here below is the screenshots of output.
0 Comment(s)