0
Array
(
[0] => Array
    (
        [lead_id] => 1
        [employee_id] => 2
        [update_date] => 2016-11-25
        [lead_status] => Fresh Leads
        [reason] => Deal Won
        [notes] => Array
            (
                [0] => Array
                    (
                        [notes] => Notes 1
                    )

                [1] => Array
                    (
                        [notes] => Notes 2
                    )

                [2] => Array
                    (
                        [notes] => Notes 3
                    )

            )

    )

[1] => Array
    (
        [lead_id] => 1
        [employee_id] => 5
        [update_date] => 2016-11-25
        [lead_status] => Fresh Leads
        [reason] => Deal Won
        [notes] => Array
            (
                [0] => Array
                    (
                        [notes] => Notes 1
                    )

                [1] => Array
                    (
                        [notes] => Notes 2
                    )

                [2] => Array
                    (
                        [notes] => Notes 3
                    )

            )

    )

[2] => Array
    (
        [lead_id] => 3
        [employee_id] => 2
        [update_date] => 2016-11-25
        [lead_status] => Fresh Leads
        [reason] => Deal Won
        [notes] => Array
            (
                [0] => Array
                    (
                        [notes] => Notes 1
                    )

                [1] => Array
                    (
                        [notes] => Notes 2
                    )

                [2] => Array
                    (
                        [notes] => Notes 3
                    )

            )

    )

)

This is my json array.
How can I get the values of each fields from this array?
Please help

George Kagan
  • 5,913
  • 8
  • 46
  • 50
Ramya Roy
  • 229
  • 4
  • 10

1 Answers1

0

This is not valid json array, you can validate your json arrays or json objects using following url

this the simple code of read json object using php

$data = '{
    "name": "Saman",
    "age": "19",
         "records":[{
                "subject1":"Maths",
                "marks":"67"

            }]
        }';

$character = json_decode($data);
echo "Name :".$character->name;
echo "Age :".$character->age; 
damith alahakoon
  • 270
  • 4
  • 14