Is there a json file x. json now php wants to read the content of the json file and search for items in the bundle as required. For example, how can I find the corresponding output for the dkey output through A03? Ask for advice! Error
Is there a json file x. json?
In php, you want to read the content of the json file and search for items in the bundle as required.
For example, the dkey value is output through A03.
How can I find the corresponding output? Ask for advice!
Error
Reply content:
Is there a json file x. json?
In php, you want to read the content of the json file and search for items in the bundle as required.
For example, the dkey value is output through A03.
How can I find the corresponding output? Ask for advice!
Error
Your json file has a bom header,
$json = file_get_contents('Qcode.json');$arr = json_decode(trim($json, chr(239) . chr(187) . chr(191)), true);$temp = array_column($arr, 'dkey', 'dvalue');echo $temp['A05'];if (! function_exists('array_column')) { function array_column(array $input, $columnKey, $indexKey = null) { $array = array(); foreach ($input as $value) { if (! isset($value[$columnKey])) { trigger_error("Key \"$columnKey\" does not exist in array"); return false; } if (is_null($indexKey)) { $array[] = $value[$columnKey]; } else { if (! isset($value[$indexKey])) { trigger_error("Key \"$indexKey\" does not exist in array"); return false; } if (! is_scalar($value[$indexKey])) { trigger_error("Key \"$indexKey\" does not contain scalar value"); return false; } $array[$value[$indexKey]] = $value[$columnKey]; } } return $array; }}
Var_dump (json_decode ($ json ));
Print out all the values first and you will know how to call them.