Hello,
I'm currently using the shell_exec command to telnet to a router and grab output. It works fine if I just want to display the output, but I also want to be able to manipulate the data. For example, I want to bold some output, highlight some output in red, and grab some data out of the output (like ip address). In perl I would do the following:
@ = some-command
;
for $line (@) {
chomp $line;
if ($line =~ /Protocol/) {
$line = "<b>" . $line . "</b><br>";
}
print $line;
}
In php I'm getting stuck here:
$output = shell_exec('some-command');
I can't figure out how to convert $output to an array. I tried using split to with newline as the separator, but couldn't get that to work. Is there another function I can use, or is there a way to do this with split?
Thank you!
-Laura