note 93775 modified in function.strrchr by danbrown
| From: | danbrown@php.net | Date: | Mon, 28 Sep 2009 17:06:15 +0000 |
| Subject: | note 93775 modified in function.strrchr by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161127@lists.php.net to get a copy of this message | ||
Easiest way to get the domain off of an email:
<?php
$domain = strrchr($email, '@');
// gets @gmail.com, with the preceding @.
?>
It's not perfect (see above in the manual), but it's pretty damn good.
--was--
Easiest way to get the domain off of an email:
<?
$domain = strrchr($email, '@');
// gets @gmail.com, with the preceding @.
?>
It's not perfect (see above in the manual), but it's pretty damn good.
http://php.net/manual/en/function.strrchr.php