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 a trait in php?

1018


What is reference variable php?

1035


How to read one character from a file?

1108


What is Different between Joomla And Magento?

2838


What is the difference between php 5 and php 7?

989


When sessions ends?

961


How to create database connection and query in php?

1045


How to declare an array in php?

1101


What are the correct and the most two common way to start and finish a PHP block of code?

1070


Do you know what does $globals means?

1043


What is the meaning of ‘escaping to php’?

1087


What is static method php?

1019


Do you know how to enable error reporting in php?

994


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

1010


What are the encryption functions available in PHP?

1136