How can we extract string 'abc.com' from a string
"http://info@abc.com" using regular expression of PHP
Answer Posted / rachana
We can use the preg_match() function with "/.*@(.*)$/" as
the regular expression pattern. For example:
preg_match("/.*@(.*)$/","http://info@abc.com",$data);
echo $data[1];
| Is This Answer Correct ? | 49 Yes | 2 No |
Post New Answer View All Answers
How do I escape data before storing it into the database?
what is mean by portal
How to get number of elements in an array?
What is the delimiter syntax is PHP's default delimiter syntax
What is a collection in php?
Which function is used in php to search a particular value in an array?
Do while loops?
What are the main error types in php?
What is x+ mode in fopen() used for?
What are differences between PECL and PEAR?
What is the purpose of the '.frm' file extension? What do thes file contain?
How to execute an sql query? How to fetch its result?
What is strlen function in php?
Explain me what are the 3 scope levels available in php and how would you define them?
What is meant by an associative array?