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 ?allinterview.com ? from a string
?http://info@allinterview.com? using regular expression of PHP?

Answer Posted / vipul dalwala

$string = "http://info@allinterview.com";
preg_match(@^(?:http://)?([^@]+)(.*)$@i', $string,
$matches);

print $matches[2]; // allinterview.com

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between abstract class and interface in php?

1132


Tell me how is it possible to return a value from a function?

1005


Is php session id unique?

979


Php being an open source is there any support available to it?

1111


Can the value of a constant change during the script's execution?

980


So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?

1044


What is encapsulation in php?

980


What is a PHP accelerator?

1050


How to join multiple strings stored in an array into a single string?

1037


How to generate a form?

1187


Applications written to provide a GUI shell for Unix and Linux are called

1050


Is php good for career?

997


What is difference between Method overriding and overloading in PHP?

1042


When to use inquire vs enquire?

985


How to pass variables and data from php to javascript?

1035