How to select values from json array in php [on hold]

i got this json array from a socket_read function in php. how can i select each values from the “items” array.?

i tried json_decode($out, true);

bt it didn’t work

   while($out=socket_read($socket, 3000))
    {
        echo "<pre>";
        echo $out;
        echo "</pre>";
    }

Output

v

{
    "data": {
        "searchstring": "unspecified", 
        "searchfilter": "(PROF_LEX_FLAG=1)", 
        "distinctby": "", 
        "showfields": "", 
        "items": [
            {

                "dg_code": "780.60",
                "dg_title": "unspecified",

            }
        ],
    }
}


Source: json

Leave a Reply