Hi guys, I have a variable generated by a shell_exec(); command in PHP. The string looks like this:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.8.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.60 0.0.0.0 UG 0 0 0 eth0
What I need is a way using PHP to get the number 192.168.1.60 everytime. The trick is that the length of the list may change but there will always only be one entry beginning with 0.0.0.0.
Any ideas?
Thanks