<?PHP$user["60"] =Array("id" and "max", "num" = "+", "Count" and "31");$user["61"] =Array("id" = "+", "num" and "+", "Count" and "34");$user["59"] =Array("id" = "i", "num" = "+", "Count" and "43");$user["56"] =Array("id" = "+", "num" and "$", "count" and "38");$user["57"] =Array("id" and "+", "num" and "All", "count" and "65");$values=array_values($user);//returns all values of an array (non-key names)$keys=Array_keys($user);//returns a new array containing all the key names in the array$iskey=array_key_exists("57",$user);//checks whether the specified key name exists in an array, returns true if the key name exists, or False if the key name does not exist. $iskey=array_key_exists(57,$user);//As a result, the type is not dependent, and the number 57 is the same as the string "57". $key=Array_keys($keys, 57);//the function returns a new array that contains all the key names in the array. If the second argument is supplied, only the key name of the value is returned. $result[' status '] = 0;$result[' Res ']=Count($key);// $result [' res '] = $user;//-----------return value is object://-----------{"status": 0, "res": {"60": {" ID ":" "num": "+", "Count": "+"}, "Max": {"id": "max", "num": "$", "Count": "" "}," "": "" id ":" the "," num ":" + "," Count ": "" "}," "": {"id": "$", "num": "", "" Count ":" ""}, "" ":" id ":" "", "num": "" "," Count ":" $ "}}}//$result [' res '] = $ values;//-----------return value is an array://-----------{"status": 0, "res": [{"id": "$", "num": "$", "Count": "},{" "id": "max", "num ":", "Count": "},{", "num": "", "" "," "" "," "Count": "},{" "id": "" "," num ":" "", "Count": "},{" "id": "page", "num": "Max", "Count": "}]}//" $result [' res '] = $keys;//-----------The return value is a one-dimensional array of key://-----------{"status": 0, "res": [ 60,61,59,56,57]}//sort ($user);//After the key is sorted, key is filtered out//$result [' res '] = $user;//-----------The return value is a multidimensional array sorted by key (not including key):// -----------{"status": 0, "res": [{"id": "},{", "num": "$", "Count": "$", "id": "$", "num": "$", "Count": "},{", "id": " "num": "+", "Count": "},{" "id": "$", "num": "+", "Count": "},{" id ":", "num": "$", "Count": "The"}]} EchoJson_encode ($result);?>
PHP multi-dimensional array Key value use