note 32545 added to function.strstr

From: Date: Fri, 30 May 2003 22:34:32 +0000
Subject: note 32545 added to function.strstr
Groups: php.notes 
Request: Send a blank email to php-notes+get-49446@lists.php.net to get a copy of this message
if u want to do the same thing only from the end of the string it is kinda simple just use strrev(). it is useful when there is a character which repeats more than once and u want to get everything from the beginning untill the last time it appears. $str = "/www/public_html/mydir/subdir"; $str = strrev(strstr(strrev($str),"/")); // $str = "/www/public_html/mydir/" ---- Manual Page -- http://www.php.net/manual/en/function.strstr.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32545 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32545&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32545&report=yes

« previous php.notes (#49446) next »