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 to get ip address of clients machine?

561


How can you increase the maximum execution time of a script in php?

521


Write a php function to convert all null values to blank?

791


What is the difference between require_once and require in php?

557


How is it possible to propagate a session id?

511






How stop the execution of a php scrip?

529


Which parts of php are case sensitive?

494


Is empty in php?

545


What is session expiry?

538


What is array filter php?

522


How does the identity operator ===compare two values in PHP?

653


Do you know how to delete a file from the system?

528


Tell me what is use of in_array() function in php?

569


What is php session_start() and session_destroy() function?

554


Does php has a future?

493