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 'techinterviews.com' from a string
'http://www.techinterviews.com' using regular expression in PHP?

Answer Posted / rajeev raj karn

$url="http://www.techinterviews.com";
$url_part=split("w{1,3}[\.]",$url);
echo $url_part[1];

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know how to get the ip address of the client?

1140


What is the difference between runtime exception and compile time exception?

1093


What is traits? How it is used in php?

1049


What does $_server means?

991


Which function would you use to read a line of data from a file in php?

1012


Do you know how to declare an array in php?

966


What is difference between array_merge and array_combine in php?

1037


What are php variables?

968


How to list all values of submitted fields?

931


What are the variables in php?

1034


How does the identity operator === compare two values?

1131


What are some new features introduced in php7?

8801


What is filter_var?

988


How to create a web form?

1016


How can you compare objects in php?

952