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 query string php?
List some of the features of php7.
What is php used for?
Is php easier than node?
Explain Booleans in PHP?
What are the __construct() and __destruct() methods in a php class?
Tell me how is it possible to propagate a session id?
Does session expire on closing browser?
How is it possible to parse a configuration file?
How to retrieve values out of an array?
What is the w3c?
Why php is used?