Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Extract email from text

<?php

function extract_emails_from($string){
  preg_match_all("/[._a-zA-Z0-9-]+@[._a-zA-Z0-9-]+/i", $string, $matches);
  return $matches[0];
}

$text = "blah blah blah blah blah blah email2@address.com";

$emails = extract_emails_from($text);

print(implode("
", $emails));

?>
Comment

PREVIOUS NEXT
Code Example
Php :: PHP utf8_decode — Converts a string from UTF-8 to ISO-8859-1, replacing invalid or unrepresentable characters 
Php :: eventon php code 
Php :: 200usd to php 
Php :: php tools for visual studio package did not load correctly 
Php :: laravel request 
Php :: Validate checkboxes laravel 
Php :: How to automail in php 
Php :: acf advanced link 
Php :: php jwt firebase 
Php :: php artisan seading 
Php :: markdown mail html rendering laravel 
Php :: Laravel Dropzone Attachment Required is not working as expected 
Php :: livewire modal to datetime-local 
Php :: add selected to dropdpown item laravel 
Php :: laravel relationship example 
Php :: get basename without extension Laravel 
Php :: small echo php 
Php :: how to cooncet dabase eith laraavel 
Php :: php execute script wait for response 
Php :: php random array name 
Php :: php code inside html 
Php :: Cant find AddHandler of PHP inside Apache configuration files 
Php :: php numeros enteros 
Php :: remove public from laravel 8 url 
Php :: php datetime format 
Php :: send parameter to function in php can null 
Php :: laravel factory counter 
Php :: php preg_replace callback 
Php :: php slim inspect request method 
Php :: at C:UsersKamyarweb-pages elebotvendorsymfonyprocessPipesWindowsPipes.php:63 laravel error 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =