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
What is difference between php and html?
Which functions are used to remove whitespaces from the string?
Can I use php in html?
What is php call function?
What is the best website to learn php?
How to get useful error messages in php?
How to call php function from javascript using ajax?
What is php used for?
What is meant by public, private, protected, static and final scopes?
What are the difference between array_keys() and array_key_exists() in php?
What is php ci?
Does exist in php?
Is php open source?
What is the role of php.ini file?
Explain the difference between php4 and php5.