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 does isset() function?

536


How to execute an sql query?

506


How is it possible to propagate a session id?

507


Tell me how would you declare a function that receives one parameter name hello?

532


What is the difference server side and browser side validation?

480






How we can declare variable in php?

508


What is the meaning of a final class and a final method?

528


sort term descripttion form, report and uery

1649


How to run the interactive php shell from the command line interface?

523


What is uniqid php?

572


What is difference between Method overriding and overloading in PHP?

543


How to convert numbers to strings in php?

515


I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?

477


what is variable scope, which variables are accessible from where and what are "undefined variable" errors?

500


What is php destruct?

524