PHP base name function example code. Learn how to use basename() function in your PHP program.
PHP base name function example code. Learn how to use basename() function in your PHP program.
This example of basename() function in PHP
Description about PHP basename():
syntax for PHP basename()Function
On giving the $path value with the file name with path it will return base file name .
if suffix is given then suffix will not come in result
Code:
<?php
$base1=basename("c:\rose1\ss.java",".java");
echo $base1;
?>
Program output:
ss
Code:
<?php
$base1=basename("c:\rose1\ss.java","");
echo $base1;
?>
Program output:
ss.java