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
What is a trait in php?
What is reference variable php?
How to read one character from a file?
What is Different between Joomla And Magento?
What is the difference between php 5 and php 7?
When sessions ends?
How to create database connection and query in php?
How to declare an array in php?
What are the correct and the most two common way to start and finish a PHP block of code?
Do you know what does $globals means?
What is the meaning of ‘escaping to php’?
What is static method php?
Do you know how to enable error reporting in php?
Whether it is possible to share a single instance of a memcache between multiple php projects?
What are the encryption functions available in PHP?