View Single Post
Old 10-21-2004, 09:28 PM   #17 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,542
sde is on a distinguished road
well take this advice from me. i've been coding php for around 5 years and this is the best words of wisdom i can give you ...
... the php manual is your friend!

not only does it have an explanation of the function, but it has examples, and a list of other functions like it on the left.

on top of that, the function search works great!

now for 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 (/).

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"
?>
does that make sense?
__________________
Mike
sde is offline   Reply With Quote