• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

using php_self returns file name and path, i just need the name

Hello.

i want simply the page name, but PHP_SELF is also displaying the folder.

<?
$page = $_SERVER["PHP_SELF"];
?>

<? echo $page; ?>      

/english/email.php is what it returns
 i need just
/email.php
 or email.php
0
jblayney
Asked:
jblayney
1 Solution
 
ldbkuttyCommented:
<?php
 $page = basename($_SERVER["PHP_SELF"]);
?>

http://www.php.net/basename
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now