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 |
Is php used anymore?
What are php variables?
Do you know what is the function mysql_pconnect() usefull for?
What is sql injection in php?
What does the unset() function mean?
What is use of count() function in php?
Tell us what is the difference between session_unregister() and session_unset()?
How can we set and destroy the cookie in php?
What is isset in php?
What is .htaccessfile and use of this file
What is the correct and the most two common way to start and finish a php block of code?
How to pass variables and data from php to javascript?