/ Published in: PHP
You may retrieve all needed file path data using PHP's built-in function pathinfo. You don't need to create your own functions or use regular expressions to get this info. It was already been created for this purpose.
URL: http://www.apphp.com/index.php?snippet=php-get-file-path-data