$arr=array( //定义数组\"name\"=>\"XXX\",\"sex\"=>\"男\",\"age\"=>\"23\",\"hobby\"=>\"爬山\",\"from\"=>\"山西\",\"tel\"=>\"110\");if(in_array(\"男\",$arr)) { // 查找键值 参数一为键值 参数二为数组echo \"Match found\";}else{echo \"Match no found\";}```if (array_key_exists(\"from\",$arr)){ //查找下标 参数一为键名,参数二为数组echo \"Match found\";}else{echo \"Match no found\";}