PHP Tutorial: Get Filename From Domain Path
<?php /**** * Purpose: get the filename from the path * Precondition: path i.e. http://domain.com/contacts.php * Postcondition: returns the filename i.e. contacts.php ****/ function fileName($path) { return substr($path, strrpos($path, '/')+1, strlen($path)); } ?>
2 Responses
[…] Filename From Domain Path […]
[…] Programming Challenge Main Page or Continue to Day 2 […]