Home > Backend Development > PHP Tutorial > PHP implements regular expression extraction email address function

PHP implements regular expression extraction email address function

WBOY
Release: 2016-07-25 08:45:28
Original
926 people have browsed it
  1. function extract_emails_from($string) {
  2. //Add judgment on #, you know this ^_^ http://blog.ddian.cn
  3. preg_match_all("/[._a-zA-Z0-9 -]+(@|#)[._a-zA-Z0-9-]+/i", $string, $matches);
  4. return $matches[0];
  5. }
Copy code

Regular expressions, PHP, email


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template