Friday, February 20, 2009

How can we extract string ‘abc.com ‘ from a string ‘http://info@abc.com’ using regular _expression of php?

preg_match(”/^(http:\/\/info@)?([^\/]+)/i”,”http://info@abc.com”, $data);
echo $data[2];

2 Comments:

At February 20, 2009 at 11:53:00 PM PST , Anonymous Anonymous said...

thanks friend for this answer.

 
At February 21, 2009 at 6:51:00 AM PST , Anonymous Anonymous said...

WONDERFULL ANSWER , REALLY USEFULL QUESTIONS.

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home