basename() example

Here you will learn the example of basename().

 
 

Share on Google+Share on Google+

basename() example

Ads

Here you will learn the example of basename().

basename()

The function basename () is used for printing the basename of the file, e.g.

<?php
$name = "c:/wamp/www/dest.txt";
echo basename($name) ."<br/>";
echo basename($name,".txt");
?>

The output of this example will print both the base name of the file with extension and basename without extension.

Advertisements

Posted on: July 30, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles