note 88361 added to function.basename

From: Date: Wed, 21 Jan 2009 09:51:32 +0000
Subject: note 88361 added to function.basename
Groups: php.notes 
Request: Send a blank email to php-notes+get-149580@lists.php.net to get a copy of this message
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. ?> ---- Server IP: 147.32.160.17 Probable Submitter: 193.85.153.130 ---- Manual Page -- http://www.php.net/manual/en/function.basename.php Edit -- https://master.php.net/note/edit/88361 Del: integrated -- https://master.php.net/note/delete/88361/integrated Del: useless -- https://master.php.net/note/delete/88361/useless Del: bad code -- https://master.php.net/note/delete/88361/bad+code Del: spam -- https://master.php.net/note/delete/88361/spam Del: non-english -- https://master.php.net/note/delete/88361/non-english Del: in docs -- https://master.php.net/note/delete/88361/in+docs Del: other reasons-- https://master.php.net/note/delete/88361 Reject -- https://master.php.net/note/reject/88361 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#149580) next »