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
"http://info@abc.com" using regular expression of PHP

Answer Posted / rachana

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

Is This Answer Correct ?    49 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Whether it is possible to share a single instance of a memcache between multiple php projects?

1007


What is difference between md5 and SHA256?

1105


How to call a php function from html button?

1083


Can age be a variable?

944


What is interface? Why it is used?

1037


What is php and sql used for?

1001


How to avoid the undefined index error?

995


How can we submit from without a submit button?

1007


Do while loops?

970


Is php coding easy?

956


How to create a mysql connection in php?

983


Explain Whitespace Characters?

1055


How to make a class in php?

980


How is it possible to know the number of rows returned in result set?

1004


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

985