View Single Post
  #9 (permalink)  
Old 04-08-2008, 10:47 PM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,162
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default Re: Filesystem Object in PHP

basename()

Given a string containing a path to a file, this function will return the base name of the file. If the filename ends in suffix this will also be cut off.

On Windows, both slash (/) and backslash (\) are used as directory separator character. In other environments, it is the forward slash (/).

example
PHP Code:
<?php
$path 
"/home/httpd/html/index.php";
$file basename($path);        // $file is set to "index.php"
$file basename($path".php"); // $file is set to "index"
?>
__________________
With,
J. Jeyaseelan

Everything Possible
Reply With Quote