Jump to content

Lacking direction on an array


Tjk

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
Link to comment
https://forums.phpfreaks.com/topic/8844-lacking-direction-on-an-array/
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

Archived

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

×
×
  • Create New...

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.