fork download
  1. <?php
  2. // http://stackoverflow.com/q/33609725/5290909
  3.  
  4. $string = '
  5. <img style="border-style: none;" title="Downloading Links"
  6. src="/wp-content/uploads/2011/12/download-links.jpg" alt="Downloading Links" /></h4>
  7. <a href="http://u...content-available-to-author-only...l.com/vp1m8880e4hd" target="blank" rel="nofollow">Uptobox</a>
  8. <a href="http://u...content-available-to-author-only...2.com/fqobh2ykscn7" target="blank" rel="nofollow">Clickupload</a>
  9. <a href="https://u...content-available-to-author-only...3.com/ian2dpkgyzio" target="blank" rel="nofollow">Usercloud</a>
  10. Password:<span style="color: #b22222;">url4.com</span>';
  11.  
  12. $dom = new DOMDocument;
  13. @$dom->loadHTML($string, LIBXML_HTML_NODEFDTD);
  14. $anchors = $dom->getElementsByTagName('a');
  15. foreach ($anchors as $anchor) {
  16. $anchor->setAttribute('href', 'link.php?url=' . base64_encode($anchor->getAttribute('href')));
  17. }
  18.  
  19. $result = $dom->saveHTML();
  20.  
  21. echo $result;
  22.  
  23. ?>
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
<html><body><img style="border-style: none;" title="Downloading Links" src="/wp-content/uploads/2011/12/download-links.jpg" alt="Downloading Links">
	<a href="link.php?url=aHR0cDovL3VybC5jb20vdnAxbTg4ODBlNGhk" target="blank" rel="nofollow">Uptobox</a>
	<a href="link.php?url=aHR0cDovL3VybDIuY29tL2Zxb2JoMnlrc2NuNw==" target="blank" rel="nofollow">Clickupload</a>
	<a href="link.php?url=aHR0cHM6Ly91cmwzLmNvbS9pYW4yZHBrZ3l6aW8=" target="blank" rel="nofollow">Usercloud</a>
	Password:<span style="color: #b22222;">url4.com</span></body></html>