1、初始化关联数组:<?php $arr=array(&拭貉强跳#39;A'=>'I','B'租涫疼迟=>'DI','C'=>'GIS');
2、用array_search函数搜索,$founded=array_search('DI',$arr);
3、用if判断输出:if($founded){ echo $founded,'找到了'稆糨孝汶;; }else{ echo '没找到'; }
4、结果如图:
1、初始化关联数组:<?php $arr=array(&拭貉强跳#39;A'=>'I','B'租涫疼迟=>'DI','C'=>'GIS');
2、用array_search函数搜索,$founded=array_search('DI',$arr);
3、用if判断输出:if($founded){ echo $founded,'找到了'稆糨孝汶;; }else{ echo '没找到'; }
4、结果如图: