Jump to content

olliemitch

New Members
  • Posts

    2
  • Joined

  • Last visited

olliemitch's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you. This was a massive help. I knew there had to be an easy way to extract from something that looked so structured.
  2. Hi, I have a string that looks like this: { "cmd": "VarReturn", "name": "temperature", "result": 947, "coreInfo": { "last_app": "", "last_heard": "2014-07-14T11:46:17.865Z", "connected": true, "deviceID": "234y8172390dfsa" } } which I have fetched from a web page using file_get_contents(); How do I put the data into variables? Either a variable for each piece of data eg $cmd = "VarReturn", $name="temperature" or into an array? At the moment I'm doing it the very messy way of using strpos() to look for each section, but I'm fairly sure there's a much easier way (using regular expressions?) but I'm a bit stuck on where to start. Any help would be much appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.