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
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.