Getting path components : basename « File Directory « PHP






Getting path components

 
<?php
$full_name = '/usr/local/php/php.ini';
$base = basename($full_name);  // $base is "php.ini"
$dir  = dirname($full_name);   // $dir is "/usr/local/php"
?>
  
  








Related examples in the same category

1.basename.php