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


Please Help Members By Posting Answers For Below Questions

What is rtrim php?

550


What library is used for pdf in php?

525


What is php mainly used for?

535


What is array filter php?

522


How does session work in php?

532






What is the difference between php and core php?

494


what is the scope of php in the future if any other language is developed then may be php is loss ???

13900


Steps for the payment gateway processing?

559


Is php front end?

510


How to execute an sql query? How to fetch its result?

578


How to know user has read the email-php?

499


What are the functions used in php?

509


Can you define an array argument as a reference type?

511


How can we pass the variable through the navigation between the pages?

547


Explain the importance of the function htmlentities.

543