Advertisement
Guest User

Untitled

a guest
Feb 26th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. a.html
  2. <pre>
  3. 1.ip
  4. 2.ip
  5. 3.ip
  6. </pre>
  7.  
  8. superdirtyandugly.php
  9. <pre>
  10. <?php
  11. $html = file_get_contents('http://localhost/a.html');
  12. $pecah = explode(PHP_EOL, $html);
  13. $html2 = file_get_contents('http://localhost/a.html');
  14. $pecah2 = explode(PHP_EOL, $html2);
  15. $html3 = file_get_contents('http://localhost/a.html');
  16. $pecah3 = explode(PHP_EOL, $html3);
  17.  
  18. if (in_array('1.ip', $pecah)) {
  19. echo '{"type":"Valid"}' . "\n";
  20. }
  21.  
  22. if (in_array('2.ip', $pecah2)) {
  23. echo '{"type":"invalid"}' . "\n";
  24. }
  25.  
  26.  
  27. if (in_array('3.ip', $pecah3)) {
  28. echo '{"type":"fix"}' . "\n";
  29. }
  30. ?>
  31. </pre>
  32.  
  33. result :
  34. $ php t.php
  35. {"type":"Valid"}
  36. {"type":"invalid"}
  37. {"type":"fix"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement