码迷,mamicode.com
首页 > Web开发 > 详细

PHP 根据值查找键名

时间:2014-06-25 15:21:41      阅读:366      评论:0      收藏:0      [点我收藏+]

标签:class   blog   code   http   com   strong   

 

array_search

(PHP 4 >= 4.0.5, PHP 5)

mixed array_search ( mixed $needle , array $haystack [, bool $strict ] )

 在数组中搜索给定的值,如果成功则返回相应的键名

 

  这个函数某种意义上能够和in_array 起到一定的作用的,当你能查找到值想对应的键名的

时候,通过if进行判断,这就是真

 

PHP 根据值查找键名,布布扣,bubuko.com

PHP 根据值查找键名

标签:class   blog   code   http   com   strong   

原文地址:http://www.cnblogs.com/sunxun/p/3806547.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!