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

How to make center align child div

 How to make center align child div?   Suppose you have 2 Div tag. And want the make inner tag center <div id="d1">      ...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive