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 the difference between abstract class and interface in php?
Tell me how is it possible to return a value from a function?
Is php session id unique?
Php being an open source is there any support available to it?
Can the value of a constant change during the script's execution?
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?
What is encapsulation in php?
What is a PHP accelerator?
How to join multiple strings stored in an array into a single string?
How to generate a form?
Applications written to provide a GUI shell for Unix and Linux are called
Is php good for career?
What is difference between Method overriding and overloading in PHP?
When to use inquire vs enquire?
How to pass variables and data from php to javascript?