Skip to content

Instantly share code, notes, and snippets.

@EHER
Created January 18, 2012 19:49
Show Gist options
  • Save EHER/1635134 to your computer and use it in GitHub Desktop.
Save EHER/1635134 to your computer and use it in GitHub Desktop.
CrowlEher
<?php
$url = urldecode($_GET['url']);
$original_file = file_get_contents($url);
$stripped_file = strip_tags($original_file, "<a>");
preg_match_all("/<a(?:[^>]*)href=\"([^\"]*)\"(?:[^>]*)>(?:[^<]*)<\/a>/is", $stripped_file, $matches);
echo '<ul>';
foreach($matches[1] as $link) {
echo '<li><a href="?url=' . urlencode($link) . '">'.$link.'</a></li>';
}
echo '</ul>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment