Hi guys, I come here as a n00b, as I'm sure a great many have, in search of your expertise.
I've only just started learning php, and it's the first language I've ever learnt (except html which doesn't count,) and although I'd say I wasn't doing too badly there are, of course, a few stumbling blocks. So, on with the problem.
I'm trying to ping a computer (through the system() command) then store the output of that in the variable "$ping". My problem is that the result of ping, which is something like
"Pinging 192.168.0.1 with 32 bytes of data: Reply from 192.168.0.1: bytes=32 time<1ms TTL=64 Ping statistics for 192.168.0.1: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms"
is not being stored as a string. Instead it will store the value 0.
For example, if I set $ping to "Nothing" and the print it, "Nothing" is printed. However on the next line of the script I run the ping command and store it in $ping. Upon printing it now $ping displays "0".
I'm sure it's simple to fix, but I just can't see it!