<?php
// http://stackoverflow.com/q/33609725/5290909
$string = '
<img style="border-style: none;" title="Downloading Links"
src="/wp-content/uploads/2011/12/download-links.jpg" alt="Downloading Links" /></h4>
<a href="http://u...content-available-to-author-only...l.com/vp1m8880e4hd" target="blank" rel="nofollow">Uptobox</a>
<a href="http://u...content-available-to-author-only...2.com/fqobh2ykscn7" target="blank" rel="nofollow">Clickupload</a>
<a href="https://u...content-available-to-author-only...3.com/ian2dpkgyzio" target="blank" rel="nofollow">Usercloud</a>
Password:<span style="color: #b22222;">url4.com</span>';
$dom = new DOMDocument;
@$dom->loadHTML($string, LIBXML_HTML_NODEFDTD);
$anchors = $dom->getElementsByTagName('a');
foreach ($anchors as $anchor) {
$anchor->setAttribute('href', 'link.php?url=' . base64_encode($anchor->getAttribute('href'))); }
$result = $dom->saveHTML();
echo $result;
?>
PD9waHAKLy8gaHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL3EvMzM2MDk3MjUvNTI5MDkwOQoKJHN0cmluZyA9ICcKCTxpbWcgc3R5bGU9ImJvcmRlci1zdHlsZTogbm9uZTsiIHRpdGxlPSJEb3dubG9hZGluZyBMaW5rcyIgCglzcmM9Ii93cC1jb250ZW50L3VwbG9hZHMvMjAxMS8xMi9kb3dubG9hZC1saW5rcy5qcGciIGFsdD0iRG93bmxvYWRpbmcgTGlua3MiIC8+PC9oND4KCTxhIGhyZWY9Imh0dHA6Ly91Li4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5sLmNvbS92cDFtODg4MGU0aGQiIHRhcmdldD0iYmxhbmsiIHJlbD0ibm9mb2xsb3ciPlVwdG9ib3g8L2E+Cgk8YSBocmVmPSJodHRwOi8vdS4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4uMi5jb20vZnFvYmgyeWtzY243IiB0YXJnZXQ9ImJsYW5rIiByZWw9Im5vZm9sbG93Ij5DbGlja3VwbG9hZDwvYT4KCTxhIGhyZWY9Imh0d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