success == true) { // create reference to our returned observation object $ob = $json->response->ob; echo sprintf("The current weather in Seattle is %s with a temperature of %d.", strtolower($ob->weather), $ob->tempF); } else { echo sprintf("An error occurred: %s", $json->error->description); } ?>