How can we extract string ‘abc.com ‘ from a string
info@abc.com" target="_blank">http://info@abc.com using
regular expression of php?

Answer Posted / ankush prasad

<?php
$string1="info@abc.com";
$string2=preg_match("/[a-c]+.[c-o]+/",$string1,$a);
print $a[0];
?>

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is $_ get?

730


How to pass variables and data from php to javascript?

723


How to support multiple-page forms?

754


Is python easier than php?

723


What websites use php?

720


What are html entities?

696


What is the correct php command to use to catch any error messages within the code?

809


How many escape sequences are recognized in double-quoted strings in php?

736


What type of operation is needed when passing values through a form or an url?

734


Why do we use csrf token?

680


What are differences between PECL and PEAR?

714


Define about declare construct?

816


Binary tree question - Node has numeric data (int) The function takes depth as argument and sum all the value of the node of the depth. For instance, (0) depth 0 / \ 10 20 depth 1 / \ / \ 40 50 60 70 depth 2 so if you pass get_sum(2), you would return 220 which is 40+50+60+70 (sum of depth2) write the function.

1723


How to write comment in php?

891


What does the php error 'parse error in php - unexpected t_variable at line x' means?

825