Sunday, September 23, 2007

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

A: i. using strstr function
Echo strstr(“http://info@abc.com”, ‘@’)
or
ii. using list and split functions
list($first,$second)=split(“@”,”http://info@abc.com”,2)
echo $second;

2 comments:

sanjay said...
This comment has been removed by the author.
sanjay said...

It will give parse error on first line can u help me