How can we extract string "w3answers.com" from a string mailto:info@w3answers.com using regular expression of PHP ?


Top Questions

Answer: 

<?php
$w3 = "mailto:info@w3answers.com";
preg_match('|.*@([^?]*)|',$w3,$w3output);
echo $w3output[1];
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
5 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Check It !

Tweet It

W3 Updates

Stay informed on our latest news!

Syndicate content