note 77369 deleted from function.strrpos by nlopess

From: Date: Sat, 01 Sep 2007 16:31:58 +0000
Subject: note 77369 deleted from function.strrpos by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-130055@lists.php.net to get a copy of this message
Note Submitter: ian at ianco uk ---- 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

« previous php.notes (#130055) next »