3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<e data-enc=\'102.WgdGDhQDAFtECwcPChIJXAsHFA8HBBMUDQ0DUVAmAQsHDwpIBQkLRFgLBxQPBwQTFA0NA1FQJgELBw8KSAUJC1pJB1g=\'/> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script> var decode = function(key, hash) { var salt = parseInt(key); var result = \'\'; for (var i=0; i<hash.length; i++) { result += String.fromCharCode(salt ^ hash.charCodeAt(i)); } return result; } $(document).find(\'e\').each(function(){ var data = $(this).data(\'enc\').split("-"); $(this).replaceWith(decode(data[0], atob(data[1]))); }); </script>'; function xor_email($str, $key) { for ($i = 0; $i < strlen($str); $i++) { $str[$i] = chr(ord($str[$i]) ^ $key); } return $str; } $doc = new DOMDocument(); libxml_use_internal_errors(true); $doc->loadHTML($html); // foreach ($doc->getElementsByTagName('e') as $e) { // parse out XORed string $enc = $e->getAttribute('data-enc'); $enc = explode('.', $enc); $decoded = xor_email(base64_decode($enc[1]), $enc[0]).PHP_EOL; // parse out email $sub_doc = new DOMDocument(); $sub_doc->loadHTML($decoded); foreach ($sub_doc->getElementsByTagName('a') as $a) { echo $a->nodeValue; } }

preferences:
27.43 ms | 408 KiB | 5 Q