note 89105 added to function.basename

From: Date: Sat, 21 Feb 2009 21:28:57 +0000
Subject: note 89105 added to function.basename
Groups: php.notes 
Request: Send a blank email to php-notes+get-150933@lists.php.net to get a copy of this message
$url = "http://www.d.com/1/2/name.phdp?id=asdf&asdf&jo.com"; $uA = explode("?",$url); $uA2 = explode("/",$uA[0]); $fn = $uA2[count($uA2)-1]; echo $fn; this is the filename of the whole url. strip the part after ? first, and get the last part after last /. if there is no ? result remains the same. ---- Server IP: 64.71.164.2 Probable Submitter: 24.215.237.195 ---- Manual Page -- http://www.php.net/manual/en/function.basename.php Edit -- https://master.php.net/note/edit/89105 Del: integrated -- https://master.php.net/note/delete/89105/integrated Del: useless -- https://master.php.net/note/delete/89105/useless Del: bad code -- https://master.php.net/note/delete/89105/bad+code Del: spam -- https://master.php.net/note/delete/89105/spam Del: non-english -- https://master.php.net/note/delete/89105/non-english Del: in docs -- https://master.php.net/note/delete/89105/in+docs Del: other reasons-- https://master.php.net/note/delete/89105 Reject -- https://master.php.net/note/reject/89105 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#150933) next »