Jump to content

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
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.