How can we extract string 'techinterviews.com' from a string
'http://www.techinterviews.com' using regular expression in PHP?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ram
$url = "http://www.techinterviews.com";
$splittedstring = explode ("www.",$url );
$str = $splittedstring[1];
echo $str ;
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sunil kumar
echo
strstr("http://www.techinterviews.com","techinterviews.com");
| Is This Answer Correct ? | 8 Yes | 9 No |
What is ci in php?
What is meant by pear in php? What is the purpose of it?
What is the function used to change the root directory in PHP?
What is session cookies php?
Name some of the popular frameworks in php.
What's the difference between using mysql_ functions and pdo?
What is the difference between explode and split?
Which PHP function would you use to send an email?
What is php destruct?
What is a stored procedure in mysql?
What is difference between required and include in php?
•How can we submit a form without a submit button