How can we extract string ?allinterview.com ? from a string
?http://info@allinterview.com? using regular expression of PHP?
Answer Posted / vipul dalwala
$string = "http://info@allinterview.com";
preg_match(@^(?:http://)?([^@]+)(.*)$@i', $string,
$matches);
print $matches[2]; // allinterview.com
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
Tell me whether it is possible to share a single instance of a memcache between multiple php projects?
How to remove the new line character from the end of a text line in php?
What is dao in php?
What is php beginner?
How to set a page as a home page in a php based site?
What is abstract class php?
What is get and post method in php?
Does session expire on closing browser?
Can we override static method in php?
Do you know what does $globals means?
What is difference Between PHP 5 and 7?
How can I prevent sql-injection in php?
What are the Advantages and Application Areas of PHP?
Where are cookies stored php?
What is the role of php.ini file?