How can we extract string 'techinterviews.com' from a string
'http://www.techinterviews.com' using regular expression in PHP?
Answer Posted / ram
$url = "http://www.techinterviews.com";
$splittedstring = explode ("www.",$url );
$str = $splittedstring[1];
echo $str ;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I install php and apache on windows 10?
What is composer install?
What is meant by urlencode and urldecode?
Binary tree question - Node has numeric data (int) The function takes depth as argument and sum all the value of the node of the depth. For instance, (0) depth 0 / \ 10 20 depth 1 / \ / \ 40 50 60 70 depth 2 so if you pass get_sum(2), you would return 220 which is 40+50+60+70 (sum of depth2) write the function.
How send email in php?
Is java is better than php?
What is restful api?
Why many companies are switching their current business language to php?
What is an array in php?
How does firefox manage cookies?
What is the maximum size of a table in mysql?
What does mysqli_query return?
What is a static variable in php?
How to assigning a new character in a string?
What are different types of runtime errors in php?