Getting path components and file extensions
<?php $info = pathinfo('/usr/local/php/php.ini'); echo $info['dirname']; echo $info['basename']; echo $info['extension']; ?>