Reputation: 1826
I'm writing a web crawler tool to collect the email addresses. After downloading the HTML content and parsing it using DomCrawler
, I get this node value:
<!--
document.write("<a rel='nofollow' href='mailto:hieubdshappy@gmail.com'>hieubdshappy@gmail.com");
//-->This email address has been protected. You need to enable JavaScript to view the content.
How could I decode it?
Upvotes: 1
Views: 78
Reputation: 6923
The value is just html encoded values of the characters from the original string so in PHP you can use html_entity_decode to get the original text.
$returnValue = html_entity_decode('mailto:hieubdshappy@gmail.com'>hieubdshappy@gmail.com', ENT_COMPAT);
See: https://www.functions-online.com/html_entity_decode.html
Upvotes: 2