How can we extract string ?allinterview.com ? from a string
?http://info@allinterview.com? using regular expression of PHP?

Answer Posted / raj

$text = "http://info@allinterview.com";
preg_match('|.*@([^?]*)|', $text, $output);
echo $output[1];

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we check the value of a given variable is a number?

608


What is meant by urlencode and urldecode?

604


What is the difference between require and include in php?

508


What are the uses of explode() and implode() functions?

531


What is php constructor?

536






Why is overriding runtime?

574


What are the differences between require and include?

567


What are global variables in php?

499


What is difference between static and constant in php?

500


How to use http headers inside php?

567


Who is the father of php and what is the current version of php and mysql?

687


What is difference between explode() or split() in PHP?

492


Tell me what does pear stands for?

552


explain php variable length argument function.

579


How is session data stored?

496