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

How can we make a constant in php?

554


How does php isset work?

526


Does php need a closing tag?

542


What is abstract class in php?

509


What sized websites have you worked on in the past?

529






What does $_env means?

547


Why laravel is best php framework?

538


How to download and install php for windows?

546


Which php global variable is used for uploading a file?

504


What is regular expression in php?

534


When are you supposed to use endif to end the conditional statement?

530


What are the different data types in javascript?

516


What does it mean when it says the csrf token is invalid?

496


Which programming language does php resemble?

529


What is the default time in seconds for which session data is considered valid?

566