I am busy creating a on and off switch based on an item in an array. I am not looking to extract the data from JSON, that already happened.
The array is created from an API, and is returned in JSON.
$json = file_get_contents($url);
$data = json_decode($json,true);
print_r($data);
The print_r result is this:
Array (
[GetDeviceListResult] => Array (
[Devices] => Array (
[0] => CanvasControllerDeviceCanvas Controller 1
[1] => LaCie 324 (2- Intel(R) Display
[2] => Realtek Digital Output (2- Real
[3] => SchedulerDevice
[4] => SneakerNetDevice
[5] => SystemDevice
)
[ServiceStatus] => Success
)
)
Signs4u
Let's say, i want the ServiceStatus. If its Success, make a green button, if its failure, make it a red button.
How do I accomplish this?