note 64604 deleted from function.strpos by nlopess
| From: | nlopess@php.net | Date: | Wed, 19 Apr 2006 10:35:47 +0000 |
| Subject: | note 64604 deleted from function.strpos by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-108546@lists.php.net to get a copy of this message | ||
Note Submitter: tim at nihonbunka dat com
----
If you want to check if a string ends with another string, then I think that you can use the fact
that strpos() returns 0 for strings found at the beginning of other strings, and reverse both
strings using strrev().
So for denying email for certain domains you might use
if (strpos(strrev($email), strrev($deniedpattern)) === 0) {
....
}
This idea comes from Hans Lellelid's code at
http://tinyurl.com/ftayb