Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Is it possible multiple inheritance in php?

1080


How do I expire a php session after 30 minutes?

1101


What is difference between count or sizeof function in php?

1049


Which is better wamp or xampp?

1018


What is == and === in php?

956


Explain me what is the use of 'print' in php?

996


Php program to generate fibonacci series?

1108


Tell me how can we define a variable accessible in functions of a php script?

991


What is the value for this auto incremented field user_pri_id?

984


What is ltrim?

968


How come the code works, but does not for two-dimensional array of mine?

1046


What are some of the advanced features of php?

1038


Is time a dependent variable?

1032


What is the capacity of mysql database?

1135


What are getters and setters php?

1072