How can we extract string 'techinterviews.com' from a string
'http://www.techinterviews.com' using regular expression in PHP?
Answer Posted / 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 |
Post New Answer View All Answers
Do you know how to get the ip address of the client?
What is the difference between runtime exception and compile time exception?
What is traits? How it is used in php?
What does $_server means?
Which function would you use to read a line of data from a file in php?
Do you know how to declare an array in php?
What is difference between array_merge and array_combine in php?
What are php variables?
How to list all values of submitted fields?
What are the variables in php?
How does the identity operator === compare two values?
What are some new features introduced in php7?
What is filter_var?
How to create a web form?
How can you compare objects in php?