How can we extract string ‘abc.com ‘ from a string
info@abc.com" target="_blank">http://info@abc.com using
regular expression of php?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How To Get the Uploaded File Information in the Receiving Script?

591


What is the purpose of constant() function?

526


Tell me what are the different types of errors in php?

517


What the use of var_dump()?

584


Can I use node js with php?

532






Difference between $message vs. $$Message in php.

589


What does the php error 'parse error in php - unexpected t_variable at line x' means?

623


Is not null mysql?

547


Does php need apache?

500


What is escape data in php?

527


Is runtime polymorphism overriding?

498


What is the special meaning of __sleep and __wakeup?

573


Which function can be used to delete a file?

594


What will the ?getdate() function returns in PHP?

646


What is a PHP accelerator?

591