Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ip = file_get_contents($path);
- $ip = explode("\n", normalize($ip));
- foreach($ip as $entry)
- {
- if(!$entry)
- continue;
- echo '<tr>';
- echo '<td class="IP">' . $entry . '</td>';
- echo '<td class="jmeno">N/A</td>';
- echo '</tr>';
- }
- function normalize($s)
- {
- // standardize line endings to unix-like
- $s = str_replace("\r\n", "\n", $s); // DOS
- $s = strtr($s, "\r", "\n"); // Mac
- // remove control characters; leave \t + \n
- $s = preg_replace('#[\x00-\x08\x0B-\x1F\x7F]+#', '', $s);
- // right trim
- $s = preg_replace("#[\t ]+$#m", '', $s);
- // trailing spaces
- $s = trim($s, "\n");
- return $s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement