Do you have this? A JSON format file X.json
Now PHP wants to read the contents of the JSON file and find the item in the bundle as required
Example: Output Dkey value via A03
How do I find the corresponding output? For advice
Error
Reply content:
Do you have this? A JSON format file X.json
Now PHP wants to read the contents of the JSON file and find the item in the bundle as required
Example: Output Dkey value via A03
How do I find the corresponding output? 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 = Arra Y_column ($arr, ' Dkey ', ' dvalue '); Echo $temp [' A05 '];if (! function_exists (' Array_column ')) {function Array_column (ARRA Y $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 exi St in Array "); return false; } if (! is_scalar ($value [$indexKey])) {trigger_error ("Key \" $indexKey \ "does not contai N scalar value "); return false; } $array[$value [$indexKey]] = $value [$columnKey]; }} return $array; }}
Var_dump (Json_decode ($json));
Print out all the values first, and you'll know how to call them.