Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a.html
- <pre>
- 1.ip
- 2.ip
- 3.ip
- </pre>
- superdirtyandugly.php
- <pre>
- <?php
- $html = file_get_contents('http://localhost/a.html');
- $pecah = explode(PHP_EOL, $html);
- $html2 = file_get_contents('http://localhost/a.html');
- $pecah2 = explode(PHP_EOL, $html2);
- $html3 = file_get_contents('http://localhost/a.html');
- $pecah3 = explode(PHP_EOL, $html3);
- if (in_array('1.ip', $pecah)) {
- echo '{"type":"Valid"}' . "\n";
- }
- if (in_array('2.ip', $pecah2)) {
- echo '{"type":"invalid"}' . "\n";
- }
- if (in_array('3.ip', $pecah3)) {
- echo '{"type":"fix"}' . "\n";
- }
- ?>
- </pre>
- result :
- $ php t.php
- {"type":"Valid"}
- {"type":"invalid"}
- {"type":"fix"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement