For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Saturday, November 08, 2014

Get Current Page Name in PHP


PROBLEM:
During coding in php, some time you need to Get Current Page Name in PHP. So How to Get Current Page Name in PHP?

SOLUTION:
Create a file "b.php" and save below content and open in browser. you will see "b.php" as page name.
<?php
function getScript() {
$file = $_SERVER["SCRIPT_NAME"];
$break = explode('/', $file);
$pfile = $break[count($break) - 1];
return $pfile;
}
echo getScript();
?>
Share:

0 comments:

Post a Comment

Multiple attribute passing in querySelectorAll

Multiple attribute passing in querySelectorAll     Here I am demonstrating code to how to pass multiple attributes in querySelectorAll. <...

Ads Inside Post

Powered by Blogger.

Arsip