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 is it possible to return a value from a function?
Which programming language does php resemble?
Tell me how can we pass the variable through the navigation between the pages?
What are the differences between session and cookie?
What is session in php w3schools?
How to randomly retrieve a value from an array?
How can I make a script that can be bilingual (supports english, german)?
How variables are passed through arguments?
What is apache and php?
What is the difference between html and php?
What does type casting mean in php? Explain with an example?
Does strlen include null?
How do you check is php not empty?
What is php glob?
Explain how can php and javascript interact?