Jump to content


Photo

Lacking direction on an array


  • Please log in to reply
1 reply to this topic

#1 Tjk

Tjk
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 01 May 2006 - 08:16 PM

[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

#2 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 01 May 2006 - 08:37 PM

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
echo is_array($pingtime)?"online":"offline";

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

btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users