fork download
  1. <?php
  2. $json = '{
  3. "ISteamClient": 0,
  4. "ISteamFriends": 0,
  5. "ISteamUser": 0,
  6. "IEconItems_440": 0,
  7. "IEconItems_730": 0,
  8. "ISteamGameCoordinator_440": 0,
  9. "ISteamGameCoordinator_570": 0
  10. }';
  11. $json_str = json_decode($json, true);
  12. $clientesteam = $json_str["ISteamClient"];
  13. echo "O Cliente Steam esta " . ($clientesteam == 0 ? "Online" : "Offline");
  14.  
  15. $json = '{
  16. "ISteamClient": 1,
  17. "ISteamFriends": 0,
  18. "ISteamUser": 0,
  19. "IEconItems_440": 0,
  20. "IEconItems_730": 0,
  21. "ISteamGameCoordinator_440": 0,
  22. "ISteamGameCoordinator_570": 0
  23. }';
  24. $json_str = json_decode($json, true);
  25. $clientesteam = $json_str["ISteamClient"];
  26. echo "\nO Cliente Steam esta " . ($clientesteam == 0 ? "Online" : "Offline");
  27.  
  28. //https://pt.stackoverflow.com/q/50095/101
Success #stdin #stdout 0s 82560KB
stdin
Standard input is empty
stdout
O Cliente Steam esta Online
O Cliente Steam esta Offline