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 a lambda function in php?
What is Mcrypt used for?
Which is better php praogramming or cad/cam scope wise and also salaray wise?
What is meant by ‘passing the variable by value and reference' in php?
Should I use mysqli or pdo?
Is php better than python?
How to repeat a string to a specific number of times in php?
How to Pass JSON Data in a URL using CURL in PHP?
What is escape data in php?
Where can I learn php?
What is the current stable version of php? What advance thing in php7?
How can we access the data sent through the url with the get method?
How to convert a string to lowercase in php?
How to track no of user logged in?
Is php fully object oriented?