Getting path components : basename « File Directory « PHP
- PHP
- File Directory
- basename
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