note 88361 deleted from function.basename by danbrown

From: Date: Fri, 23 Jan 2009 18:04:06 +0000
Subject: note 88361 deleted from function.basename by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-149708@lists.php.net to get a copy of this message
Note Submitter: kepak at itcrowd dot cz ---- Here is another nice example, how to extract name without extension :) <?php function nameOnly($path){ $full_name = basename($path); return (substr($full_name, strrpos($full_name, '.')+1)); } This function will find last . in the path, and remove all that is behind it. ?>

« previous php.notes (#149708) next »