Re: object oriented syntax in php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



echo $ping_result["_raw_data"][5];

> Hi there,
>
> I do have problems with object oriented syntax as this is not familar to
> me. There is following output:
>
>
> object(net_ping_result)(11) { ["_icmp_sequence"]=>  array(1) {
> ["61.117):"]=> string(1) "7" } ["_target_ip"]=>  string(9) "y2.php.ne"
> ["_bytes_per_request"]=> string(2) "64" ["_bytes_total"]=>  int(192)
> ["_ttl"]=>  string(6) "_seq=2" ["_raw_data"]=>  array(7) { [0]=> 
> string(72) "PING php.net (66.163.161.117) from 192.168.1.114 : 56(84) bytes
> of data." [1]=>  string(72) "64 bytes from y2.php.net (66.163.161.117):
> icmp_seq=1 ttl=47 time=211 ms" [2]=>  string(72) "64 bytes from y2.php.net
> (66.163.161.117): icmp_seq=2 ttl=47 time=206 ms" [3]=> string(0) "" [4]=> 
> string(31) "--- php.net ping statistics ---" [5]=> string(55) "2 packets
> transmitted, 2 received, 0% loss, time 1008ms" [6]=> string(55) "rtt
> min/avg/max/mdev = 206.299/209.139/211.979/2.840 ms" } ["_sysname"]=> 
> string(5) "linux" ["_round_trip"]=>  array(3) { ["min"]=> string(7)
> "209.139" ["avg"]=>  string(7) "211.979" ["max"]=>  string(5) "2.840" }
> ["_transmitted"]=>  string(1) "2" ["_received"]=>  string(1) "2"
> ["_loss"]=> int(0) }
>
>
> Now I would like to retrieve my needed info out of it. How do I do this?
> (sounds a bit silly this question, sorry :-)
>
> I tried:
> $ping_result = $ping->ping('php.net');
> echo $ping_result["net_ping_result"]["_raw_data"][5];
>
> But this and other tries did not work. My goal is to find out wheter a
> specified site is reachable.
>
> Can anybody give me a hint on this one?
>
> Thank you in advance,
>
> Merlin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux