Jump to content

Archived

This topic is now archived and is closed to further replies.

Tjk

Lacking direction on an array

Recommended Posts

[a href=\"http://pastebin.com/692931\" target=\"_blank\"]http://pastebin.com/692931[/a]

$pingtime just echos as "ARRAY" on the page at the moment. What I'm trying to do from here is to create a way of registering if a server responds to a ping and if not then display "offline". Any ideas how I could do this from here?

((Had to use postbin because of the forum security feature bug)) :)

Regards

Share this post


Link to post
Share on other sites
So apparently $pingtime is only an array if the ping was successful
right?

so set an IF statement, or my favorite a ternary statement that does this
[code]echo is_array($pingtime)?"online":"offline";
[/code]

note that that would only display offline or online

this is a 3rd party script
it's being moved there

please post in the correct forum

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.