Guest User

Untitled

a guest
Feb 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2. $str = file_get_contents("foo.txt");
  3.  
  4. preg_match_all("/^(.*) (http.*)\s*$/m", $str, $matches);
  5. print_r($matches);
  6. echo("<!doctype html><html><head><title>stuff</title></head><body>\n");
  7. echo("<ul>\n");
  8. for($i=0;$i<count($matches[0]);$i++){
  9. echo("<li><a href=\"".$matches[2][$i]."\">".$matches[1][$i]."</a></li>\n");
  10. }
  11. echo("</ul>\n");
  12. echo("</body></html>\n");
Add Comment
Please, Sign In to add comment