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 |
Why ide is recommended for use while programming with php?
what do you mean by php.ini file ?????????
Explain me how failures in execution are handled with include() and require() functions?
How to uploaded files to a table?
How would you impletement download and upload a file in php
Explain the types of string comparision function in PHP
What is query string php?
How to read a file in php?
How to set session.gc_divisor properly?
What is an array in php?
Tell me how is the ternary conditional operator used in php?
Suppose your Zend engine supports the mode <? ?> Then how can u configure your PHP Zend engine to support <?PHP ?> mode ?
1 Answers Rushmore Consultancy,