Hello friends, today in this trick, I will show you how you can extract email addresses from long text with the help PHP code script.
We will use the preg_match_all()
function to extract the email addresses from the text, string or long paragraph.
Output
[email protected] [email protected]
You can convert this PHP snippet into a function and then pass any text in the function as an argument and extract all valid email addresses from the text.
See Also: How to Check String Contains a Specific Word in PHP?
Being Tricky 😉