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];
?>
Answer:
<?php
$w3 = "mailto:info@w3answers.com";
preg_match('|.*@([^?]*)|',$w3,$w3output);
echo $w3output[1];
?>
Post new comment