dirname.php : dirname « File Directory « PHP






dirname.php

 
<?php
   $path = "/home/www/data/users.txt";
   $dirname = dirname($path); // $dirname contains "/home/www/data"
?>
  
  








Related examples in the same category

1.Use dirname() with predefined variable $SCRIPT_FILENAME to obtain the complete path of the script executing the command