美女直播全婐网站免费,办公室里呻吟的丰满老师,国产伦精品免编号公布,欧美老熟妇乱人伦人妻

中山php|最優(yōu)網(wǎng)絡(luò)中山做網(wǎng)站 中山php建站

最優(yōu)良人

2012/12/17 at 20:48

php多維數(shù)組的搜索

1 php搜索多維數(shù)組的鍵值

如下面例子:

$foo[1]['a']['xx'] = 'bar 1';
$foo[1]['b']['xx'] = 'bar 2';
$foo[2]['a']['bb'] = 'bar 3';
$foo[2]['a']['yy'] = 'bar 4';
$foo[3]['c']['dd'] = 'bar 3';
$foo[3]['f']['gg'] = 'bar 3';
$foo['info'][1] = 'bar 5';

如果要查找 bar 3 怎么進(jìn)行查找呢。有三個(gè)結(jié)果,而這三個(gè)結(jié)果都要,看下面的函數(shù):
-------------------------------------------------------------------------------------------------------------------------------
function array_search_re($needle, $haystack, $a=0, $nodes_temp=array()){
global $nodes_found;
$a++;
foreach ($haystack as $key1=>$value1) {
??? $nodes_temp[$a] = $key1;
??? if (is_array($value1)){???
????? array_search_re($needle, $value1, $a, $nodes_temp);
??? }
??? else if ($value1 === $needle){
????? $nodes_found[] = $nodes_temp;
??? }
}
return $nodes_found;
}
---------------------------------------------------------------------------------------------------------------------------------
這個(gè)函數(shù)就可以把上面要查找到的內(nèi)容全部返回出鍵名來(lái)
$result = array_search_re('bar 3', $foo);

print_r($result);

輸出結(jié)果為如下:
Array ( [0] => Array ( [1] => 2 [2] => a [3] => bb )
?????? ?? [1] => Array ( [1] => 3 [2] => c [3] => dd )
?????? ?? [2] => Array ( [1] => 3 [2] => f [3] => gg )
???? ?? )

1 php搜索多維數(shù)組的鍵名

function array_search_key($needle, $haystack){
global $nodes_found;

foreach ($haystack as $key1=>$value1) {
?
?if ($key1=== $needle){
?
??$nodes_found[] = $value1;
???????
?? }
??? if (is_array($value1)){???
????? array_search_key($needle, $value1);
??? }
???
???
}

return $nodes_found;
}
$result = array_search_key('a', $foo);

print_r($result);

輸出結(jié)果為如下:
?

Array
(
??? [0] => Array
??????? (
??????????? [xx] => bar 1
??????? )

??? [1] => Array
??????? (
??????????? [bb] => bar 3
??????? )

??? [2] => Array
??????? (
??????????? [yy] => bar 4
??????? )

)

標(biāo)簽:,
-
午夜福利在线观看午夜电影街bt| 被两个按摩师用春药按摩| 狠狠躁日日躁夜夜躁2022麻豆| 精品国产伦一区二区三区在线观看| 年轻的小婊2韩剧中文版| 免费人妻精品一区二区三区| japanese丰满人妻hd| free紧videoxx粗又长| 18无码av精品一区二区三区| 豪妇荡乳1一5全集| 久久午夜伦鲁片免费无码| 377人体粉嫩噜噜噜| 他用嘴巴含着我奶头好舒服| 熟妇与小伙子matur老熟妇e| 成年裸男自慰gay网站| 富婆性俱乐部纵欲狂| 国产又黄又爽又刺激的免费网址| av无码精品一区二区三区宅噜噜| 丰满大码的熟女在线视频| 久久精品国产精品亚洲毛片| 小婷的性放荡日记| 色综合久久无码五十路人妻| 欧美日韩人妻精品一区二区三区| 姐姐真漂亮高清在线观看| 日本夜爽爽一区二区三区| 强奷漂亮少妇高潮| 欧美黑人添添高潮a片视频| 麻豆亚洲av成人无码久久精品| 图书馆h含着粉嫩小奶头h漫画| 国产人妻高清国产拍精品| 国产人妻777人伦精品hd| 人妻少妇精品久久| 自慰被室友看见强行嗯啊男男| chinese熟妇与小伙子mature| ai换脸赵露思又疼又叫| 国产又黄又爽又猛免费视频播放| 挺进毛还没长稚嫩的小花苞网种| 色综合久久五月色婷婷| 粉嫩极品国产在线观看| 天堂网在线.www天堂在线资源| 浴室里强摁做开腿呻吟的漫画|