Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $output = shell_exec ("last | head -10 | grep -ve reboot");
- $by_line_res = preg_split(("/\\n/"), $output);
- for($i = 0; $i < 5; $i++) {
- preg_match("/ \d+:\d+/ ", $by_line_res[$i], $match);
- echo $match[0];
- echo " - ";
- preg_match("/\w+ /", $by_line_res[$i], $match);
- echo $match[0];
- echo " - ";
- echo "\n";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement