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 are the popular content management systems (cms) in php?
Explain NULL?
is that "enumerated array" equal to "numeric array"?
Suppose a variable may passed to other page using any of get,post,session,cookie methods and u want to retrive that variable value . what is the syntax?
What type of comments are supported by PHP.
What is the functionality of the function html entities?
does current version of mysql (myisam) supports foreign keys ?
Whats the difference between include() and require()?
How to call javascript function in php without any event?
What is php regular expression?
What is difference between mysqli and mysql?
What the use of var_dump()?