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 php regular expression?
what mode to use when creating dirs with mkdir?
How can we destroy the session, how can we unset the variable of a session?
Explain the difference between static and dynamic websites?
What is slim framework?
What is php oop?
What is difference between python and php?
How to restrict the number of users login ? For ex:- if the allowed login is 10, for 11th user, the application should restrict them from login.
What is the most common http method?
Which array function checks if the particular key exists in the array?
Does cors prevent csrf?
What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?