note 69662 deleted from function.strstr by bobby

From: Date: Thu, 14 Sep 2006 15:47:51 +0000
Subject: note 69662 deleted from function.strstr by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-117160@lists.php.net to get a copy of this message
Note Submitter: ---- I've made a reverse of this function using strrev. Here it is with an example: <?php // Reverse of strstr by Nesianstyles, // Email: crazy.stu@gmail.com function strstrrev($haystack, $needle) { return strrev(strstr(strrev($haystack), strrev($needle))); } $email = 'user@example.com'; $user = strstrrev($email, '@'); echo $user; // prints user@ ?>

« previous php.notes (#117160) next »