dirname: get the directory name for a file : File « File Directory « PHP






dirname: get the directory name for a file


<?php
   $path = "./test.txt";
   $dirname = dirname($path);
   
   echo $dirname;
?>

           
       








Related examples in the same category

1.realpath: Returns canonicalized absolute pathname
2.File base name