note 73809 added to function.strrchr

From: Date: Sun, 11 Mar 2007 13:49:32 +0000
Subject: note 73809 added to function.strrchr
Groups: php.notes 
Request: Send a blank email to php-notes+get-124344@lists.php.net to get a copy of this message
One of the quickest way to accquire filename and its extension. <?php // Returns filename "yourfile.avi" and fileextension ".zip" $file = "yourfile.avi.zip"; $fileextension = strrchr($file, "."); $filename = str_replace("$fileextension", "", $file); // Returns filename "yourfile" and fileextension ".zip" $file = "yourfile.avi.zip"; $fileextension = strrchr($file, "."); $fileextensions = strstr($file, "."); $filename = str_replace($fileextensions, "", $file); ?> ---- Server IP: 195.136.184.34 Probable Submitter: 83.30.200.54 ---- Manual Page -- http://www.php.net/manual/en/function.strrchr.php Edit -- https://master.php.net/note/edit/73809 Del: integrated -- https://master.php.net/note/delete/73809/integrated Del: useless -- https://master.php.net/note/delete/73809/useless Del: bad code -- https://master.php.net/note/delete/73809/bad+code Del: spam -- https://master.php.net/note/delete/73809/spam Del: non-english -- https://master.php.net/note/delete/73809/non-english Del: in docs -- https://master.php.net/note/delete/73809/in+docs Del: other reasons-- https://master.php.net/note/delete/73809 Reject -- https://master.php.net/note/reject/73809 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#124344) next »