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

What are PHP Magic Methods/Functions. List them.

1106


How do you use end in python?

1111


what is benefit of magento?

2582


What happens when submit button is clicked?

993


What is the meaning of symbol '$' in jquery?

1120


What is static method php?

1050


What is the difference between session_unregister() and session_unset()?

1157


How to create an array in php?

1150


How to get complete current page url in php?

1114


Tell me what does pear stands for?

1133


Explain how to run the interactive php shell from the command line interface?

1109


Php program to generate fibonacci series?

1102


Is facebook still written in php?

1030


What is isset in php?

1046


Define soundex()?

997