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 / rajan vardawaj

We can use the preg_match() function with “/.*@(.*)$/” as
the regular expression pattern. For example:
preg_match(”/.*@(.*)$/”,”info@abc.com”,$data"
target="_blank">http://info@abc.com”,$data); echo $data[1];

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What type of headers that PHP supports?

797


Is rent a variable cost?

736


What is trait in php?

736


Tell me when a conditional statement is ended with an endif?

693


Does php require a web server?

711


How error handling is being handled by php?

762


Is numeric in php?

749


What is a simple php method to make a cross domain data request?

708


What is a persistent cookie in php?

739


What is meant by PEAR in PHP?

737


Explain which cryptographic extension provide generation and verification of digital signatures?

772


Suppose your zend engine supports the mode Then how can you configure your php zend engine to support Mode ?

751


How does php work?

727


How many keywords are there in php?

856


What does namespace mean in php?

762