简体   繁体   中英

Pull specific data from PHP array

I wrote a function wheere I need to store some data in database. I have multidimensional associative array.

I dumped one part of the code..

When I dump:

            $csv->setCode($data[7]);

            dump($data[7]);die;

and I get

"{"id":"131-2-0-615317","o":"raccoon-events-ltd","j":"Member of the...","c":"Sport For All..."}"

Now, I need to pull out just the "ID" part of the code..

I just tried:

dump($data[7]=>id);die;

Its JSON use this code:

$json = json_decode($data[7],true);
dump($json['id']);die;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM