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
Which is the best web server?
which will print out the php call stack?
Can I use node js with php?
What is isset post?
can you give me an example code of calling java script function in php variable using AJAX.or with out ajax??????
What is x+ mode in fopen() used for?
What are php loops?
Explain the value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?
What is the most common http method?
What is member function?
What is curl php?
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what is the problem?
In php, objects are they passed by value or by reference?
What is difference between include and include_once in php?
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.