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 rules to declare a php variables?
What are some of the advanced features of php?
How can we change the value of a constant?
Which php framework is in demand?
How to execute an sql query?
What is the use of trim function in php?
Tell me what is the default session time in php?
How can we submit a form without a submit buttom?
12 Answers A1 Technology, IBM,
How can I increase my website session?
i got this error msg in online... how to solve this problem... i couldnot find out as soon as possible send me answer or idea COULD NOT ABLE TO CONNECT DATABASE . Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)
Require_once(), require(), include(). What is difference between them?
What are php errors?