note 77369 added to function.strrpos

From: Date: Sun, 26 Aug 2007 18:56:10 +0000
Subject: note 77369 added to function.strrpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-129822@lists.php.net to get a copy of this message
To bharath: Quick and dirty, to illustrate strrpos: <?php $filepath = 'www.google.com/index.htm'; $v = strrpos($filepath, '/'); if (false !== $v) $v ++; // '/' was found (if it wasn't, $v will be treated as 0 in the next line) $filename = substr($filepath, $v); echo $filename; ?> But have a look at parse_url if you are dealing with URLs. And you can get into trouble for asking questions here! See http://uk2.php.net/support.php ---- Server IP: 194.145.210.4 Probable Submitter: 84.92.139.196 ---- Manual Page -- http://www.php.net/manual/en/function.strrpos.php Edit -- https://master.php.net/note/edit/77369 Del: integrated -- https://master.php.net/note/delete/77369/integrated Del: useless -- https://master.php.net/note/delete/77369/useless Del: bad code -- https://master.php.net/note/delete/77369/bad+code Del: spam -- https://master.php.net/note/delete/77369/spam Del: non-english -- https://master.php.net/note/delete/77369/non-english Del: in docs -- https://master.php.net/note/delete/77369/in+docs Del: other reasons-- https://master.php.net/note/delete/77369 Reject -- https://master.php.net/note/reject/77369 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129822) next »