Hello,
I have an piece of hardware that returns tempature data etc. I am not sure what format this is though. I would like to parse it with php any suggestions on the best or easiest way to parse the data. I will be storing the data in a mysql database and this data will be inserted one every 30 seconds.
Below is the data:
{name:"Enviro",date:"07/22/10 17:32:34",uptime:"0d 19:06:28",scale:0,macaddr:"00:XX:XX:XX:XX:XX",devtype:"24",refresh:"30",sensor:[{label:"Rack Temp",tempf:"70.88",tempc:"21.60",highf:"72.50",highc:"22.50",lowf:"69.98",lowc:"21.10",alarm:1,type:38,enabled:1,humid:"37.27",highh:"45.72",lowh:"34.01",heati:"76.79",heatic:"24.88",highhi:"77.07",highhic:"25.03",lowhi:"76.57",lowhic:"24.76",hienabled:0},{label:"Ext. Sensor 1",tempf:"32.00",tempc:"0.00",highf:"32.00",highc:"0.00",lowf:"32.00",lowc:"0.00",alarm:0,type:0,enabled:0},{label:"HVAC",tempf:"46.27",tempc:"7.93",highf:"67.87",highc:"19.93",lowf:"43.70",lowc:"6.50",alarm:1,type:16,enabled:1},{label:"Ext. Sensor 3",tempf:"32.00",tempc:"0.00",highf:"32.00",highc:"0.00",lowf:"32.00",lowc:"0.00",alarm:0,type:0,enabled:0},{label:"Ext. Sensor 4",tempf:"32.00",tempc:"0.00",highf:"32.00",highc:"0.00",lowf:"32.00",lowc:"0.00",alarm:0,type:0,enabled:0},{label:"Ext. Sensor 5",tempf:"32.00",tempc:"0.00",highf:"32.00",highc:"0.00",lowf:"32.00",lowc:"0.00",alarm:0,type:0,enabled:0},{label:"Ext. Sensor 6",tempf:"32.00",tempc:"0.00",highf:"32.00",highc:"0.00",lowf:"32.00",lowc:"0.00",alarm:0,type:0,enabled:0}],switch_sen:[{label:"Air Flow",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0},{label:" ",enabled:1,alarm:1,status:0}]}