From: Banana Date: Tue, 16 Jul 2019 13:35:04 +0000 (+0200) Subject: extract emails from string X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=9b2dc55c30ebdd8fcf0707cf93ccb5a6cc8f7ccc;p=dolphin.git extract emails from string --- diff --git a/single-functions/extract-email-links.php b/single-functions/extract-email-links.php new file mode 100644 index 0000000..feb7a34 --- /dev/null +++ b/single-functions/extract-email-links.php @@ -0,0 +1,37 @@ +]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))#'; + + preg_match_all($urlpattern, $string, $matches); + if(isset($matches[0]) && !empty($matches[0])) { + foreach($matches[0] as $match) { + $ret[md5($match)] = $match; + } + } + + + return $ret; +}