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 are the data types in php?
How to add comments in php?
Is php front end?
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 many types of arrays are there in php?
What is the difference between get and post method in php?
How do you end a function in python?
Where is my php ini file?
What are the features of object-oriented programming in php?
What is the main difference between php 4 and php 5?
Do you know what is the use of the function 'imagetypes()'?
Explain the difference between unlink() and unset()?
How do you end a session in php?
How to get no. of rows using MYSQL function?
What is the use of addslashes in php?