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 to redirect a url from http to https in .htaccess?
How error handling is being handled by php?
What is asort php?
How to remove leading and trailing spaces from user input values?
How to download and install php on windows?
What are the features of php?
What is the Default syntax used in PHP?
What is echo in html?
What are the differences between php constants and variables?
What is list function with their uses.
What is in php 7?
How do I escape data before storing it in the database?
What is faster in php?
What are psrs?
Which php framework is fastest?