You can use basename()
and $_SERVER['PHP_SELF']
to get current page file name
echo basename($_SERVER['PHP_SELF']); /* Returns The Current PHP File Name */
Related Contents:
- move_uploaded_file gives “failed to open stream: Permission denied” error
- How does PHP ‘foreach’ actually work?
- startsWith() and endsWith() functions in PHP
- How to get ID of the last updated row in MySQL?
- MySQLi prepared statements error reporting [duplicate]
- Convert time in HH:MM:SS format to seconds only?
- What’s the difference between echo, print, and print_r in PHP?
- Should we ever check for mysqli_connect() errors manually?
- Sorting an associative array in PHP [duplicate]
- Warning: mysqli_select_db() expects exactly 2 parameters, 1 given
- Upload a file using PHP
- How can I replace newline or \r\n with ?
- PHP list all files in directory [duplicate]
- Access PHP var from external javascript file
- Can you store a function in a PHP array?
- Convert utf8-characters to iso-88591 and back in PHP
- How exactly is a PHP script executed?
- Show a PDF files in users browser via PHP/Perl
- MySQL statement takes more than minute to execute
- Can you put PHP inside PHP with echo? [closed]
- phpexcel to download
- Laravel Eloquent Sum of relation’s column
- Merging two images with PHP
- How to create an error 404 page using PHP?
- Error “Target class controller does not exist” when using Laravel 8
- My pattern isn’t matching a ISO style date, why? [duplicate]
- What does this symbol mean in PHP
- file_get_contents receive cookies
- PHP variable scope between code blocks
- Laravel eager loading with limit
- Google GCM server returns Unauthorized Error 401
- PHP – split String in Key/Value pairs
- jQuery AJAX form using mail() PHP script sends email, but POST data from HTML form is undefined
- Does UTC observe daylight saving time?
- How to get Time Zone through IP Address in PHP [duplicate]
- PHP PDO and MySQLi [duplicate]
- Create a dynamic mysql query using php variables
- Expected response code 220 but got code “”, with message “” in Laravel
- Efficiently pick n random elements from PHP array (without shuffle)
- Parsing CSS by regex
- Get the path with query string on the current http request in PHP [duplicate]
- Use PHP composer to clone git repo
- Get filename of file which ran PHP include
- How to define a Laravel route with a parameter that contains a slash character
- Running a Zend Framework action from command line
- Can I get the value of a private property with Reflection?
- Change foreign characters to their roman equivalent
- PHP fwrite new line
- PHP mySQL – Insert new record into table with auto-increment on primary key
- mysql error ‘TYPE=MyISAM’