How to get current PHP page name ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to get current PHP page name ?

hello Sololearn,How to get current PHP page name For example: I'm on page "mypage1.php", so i need to set this page name to variable pageName,smth like that : $pageName = getPageName;

28th Jul 2018, 12:24 PM
Fury
2 Answers
+ 2
You can get the file name of the current page with basename($_SERVER['PHP_SELF']);
28th Jul 2018, 1:06 PM
Quincy
+ 1
thank
28th Jul 2018, 2:24 PM
Fury