How can we extract string ‘abc.com ‘ from a string
info@abc.com" target="_blank">http://info@abc.com using
regular expression of php?
Answers were Sorted based on User's Feedback
Answer / simlu_irtt
$string1="info@abc.com";
$string2=split("@",$string1);
print_r($string2);
this code print the string as abc.com
| Is This Answer Correct ? | 23 Yes | 6 No |
Answer / simlu_irtt
$string1="info@abc.com";
$string2=split("@",$string1);
print_r($string2);
this code print the string as abc.com
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / ankush prasad
<?php
$string1="info@abc.com";
$string2=preg_match("/[a-c]+.[c-o]+/",$string1,$a);
print $a[0];
?>
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / harsh
$string1="info@abc.com";
$string2=split("@",$string1);
print_r($string2);
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / supriya
$str1="info@abc.com";
$str1=explode("@",$str1);
print_r($str1);
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / rajan vardawaj
We can use the preg_match() function with “/.*@(.*)$/” as
the regular expression pattern. For example:
preg_match(”/.*@(.*)$/”,”info@abc.com”,$data"
target="_blank">http://info@abc.com”,$data); echo $data[1];
| Is This Answer Correct ? | 2 Yes | 3 No |
How do you remove whitespace from the beginning and end of a $string variable?
What is implode() in php?
How does csrf attack work?
What is meant by session in php?
hello experts good morning to everyone ! at present am now learning LAMP course sir( linux, apache,mysql and php) after finishing this course can i create my own website without investment is it possible ? please can any one tell sir and also tell me how can i upload my project after finishing the project in internet ? please tell the ways sir please send ur valuable suggestions to kiranpulsar2007@gmail.com
we have two tables first one is EMPLOYEE having EmpID, EmpNAME, Second table is SALARY table having id, salary Write a query to get name of those person who having more than 10000$ salary
What is The difference between ' and " where they can ben in between or outmost and how
What is the difference between array_merge() and array_merge_recursive() in php?
does current version of mysql (myisam) supports foreign keys ?
What is exception in php?
How to define a function with any number of arguments?
How do I run a php script?