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 are php sessions stored?
How do I escape data before storing it into the database?
What is php regular expression?
Explain me what is the w3c?
What is the use of count() function in php?
Should I use mysqli or pdo?
What is an array in php?
What is the empty function?
Name some of the popular frameworks in php.
How to concatenate two strings in php?
What is php glob?
Do you know how can we check the value of a given variable is a number?
CWD is a type of shell variable. State Whether True or False?
Which php global variable is used for uploading a file?
What are global variables in php?