i漂泊

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3600|回复: 0

搜索某值是否存在多为数组中,如果存在返回存在的数组;

[复制链接]
TA的礼物信息
  • 收到:0
  • 送出:2
发表于 2013-12-23 14:02:35 | 显示全部楼层 |阅读模式
  1. /*
  2. * 搜索某值是否存在多为数组中,如果存在返回存在的数组;
  3. */

  4. function _in_array_value($piaobo_value, $array) {
  5.     foreach ($array as $key) {
  6.         if(!is_array($key)){
  7.             if($key == $piaobo_value){
  8.                 return $key;
  9.             }else{
  10.                 continue;
  11.             }
  12.         }
  13.         if(in_array($piaobo_value,$key)){
  14.             return $key;
  15.         }else if(_in_array_value($piaobo_value,$key)){
  16.             return $key;
  17.         }
  18.     }
  19.     return false;
  20. }
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|IPiaoBo Inc. ( 渝ICP备17002826号 )

GMT+8, 2024-5-5 13:17 , Processed in 0.073654 second(s), 43 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表