Below is the data which is stored in a JSON file and I need to read the below data using PHP and after reading I want to store it in MySQL.
{
"CONTACTDETAILS": [
{
"checkList_Id_PointNo": "1",
"checkList_Name": "Substation earthing layout clearly making the position or earthing pits with identification number and the route of earthing lead / strip",
"checkList_Status": "OK",
"checkList_Remark": "Remark ",
"checkList_Photo": "11EarthingDG Earthing1"
},
{
"checkList_Id_PointNo": "2",
"checkList_Name": "All earhting pits should have identification number as indicated in earthing layout written over them with permanent paint",
"checkList_Status": "Not OK",
"checkList_Remark": "Remark 2",
"checkList_Photo": "11EarthingDG Earthing2"
},
{
"checkList_Id_PointNo": "3",
"checkList_Name": "Earthing pits should be clean and no unwanted material or vegetation should be present in the pits",
"checkList_Status": "Not Applicable",
"checkList_Remark": "Remark 5",
"checkList_Photo": "11EarthingDG Earthing3"
},
{
"checkList_Id_PointNo": "4",
"checkList_Name": "Earthing pit chamber should be painted and plastered on both surfaces",
"checkList_Status": "OK",
"checkList_Remark": "Yyyyyyy",
"checkList_Photo": "11EarthingDG Earthing4"
}
]
}
You have to try decode this json formate by using function json_decode($jsonVariable)
or follow this link JSON_DECODE . This function convert into array and they print by using foreach
loop