0

Hi this is the deepest I have ever dove into PHP because today I started using curl to access the Proofhub REST API. I have managed to get the data I wanted from the API but now I want to use that data to create a dashboard.

I want to use the file I created with the JSON array to set variables in PHP. Variables like id name, variables that correspond to the data I have in the JSON array.

Section of JSON Array file:

{
"id": 896585647,
"title": "Butterfly Scheme Project",
"description": null,
"color": "#B200FF",
"start_date": "2016-06-08",
"end_date": null,
"template": false,
"sample_project": false,
"status": {
  "id": 262601041
},
"favourite": false,
"favourite_sort": null,
"import_id": 0,
"assigned": [
  1228530673,
  1228517105,
  1228625654,
  2004959642,
  1228503536
],
"category": {
  "id": 665985348
},
"creator": {
  "id": 1228530673
},
"manager": {
  "id": 1228530673
},
"created_at": "2016-06-08T09:51:52+00:00",
"updated_at": "2018-02-15T11:25:12+00:00"
}

I understand that I may have to use include or file_get_contents to acheive this, but I just don't know how. I hope you can help.

3
  • 1
    Can you post what you have tried so far? the code you are using to fetch the file at least? post it in the question by editing it. Commented Apr 10, 2018 at 14:47
  • 1
    You are looking for json_decode Commented Apr 10, 2018 at 14:48
  • You'll want to do json_decode(file_get_contents('blah.json'), true); Commented Apr 10, 2018 at 15:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.