<?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)); } ?>
Programming Challenge Main Page or Continue to Day 3
Advertisements
Pingback: Programming Challenge: 31 Code Snippets in 31 Days « Online Game Development
Pingback: Programming Challenge Day 1: Format Dates Taking Country Into Consideration « Online Game Development