hpze2000 最近的时间轴更新
hpze2000

hpze2000

V2EX 第 41987 号会员,加入于 2013-07-12 14:50:05 +08:00
这个能否改成递归, 并在指定层级退出循环
PHP  •  hpze2000  •  2017-07-26 17:14:51 PM  •  最后回复来自 hpze2000
22
想完下 react native 安装的时候出现这样的问题 ,谁知道的 MAC 上
Node.js  •  hpze2000  •  2015-06-02 22:10:03 PM  •  最后回复来自 jiaenyue
5
为什么 显示更多只能, 是按最新的排序啊
程序员  •  hpze2000  •  2013-11-26 15:19:46 PM  •  最后回复来自 bearcat001
1
求一个PHP正则 字符串处理
程序员  •  hpze2000  •  2013-10-30 16:44:06 PM  •  最后回复来自 hui314
3
windows 任务栏, 右下角的 时间栏, 重写 , 有人知道吗?
程序员  •  hpze2000  •  2013-10-14 09:44:19 AM  •  最后回复来自 hpze2000
8
有没有支持大文件断点上传的 flash上传控件
程序员  •  hpze2000  •  2013-10-09 10:14:59 AM  •  最后回复来自 chinazdg
3
hpze2000 最近回复了
2017-07-26 17:14:51 +08:00
回复了 hpze2000 创建的主题 PHP 这个能否改成递归, 并在指定层级退出循环
@xqin 这些值都是动态的, 没有一个是明确的,而且层级也不确定 你这样不合适。
2017-07-26 16:24:42 +08:00
回复了 hpze2000 创建的主题 PHP 这个能否改成递归, 并在指定层级退出循环
设计是无限极,由客户端参数产生, 但是也没有 那么深的层次, 主要是只能用递归来实现逻辑
@littleylv 恩, 可以使用,谢谢
2017-07-26 15:28:55 +08:00
回复了 hpze2000 创建的主题 PHP 这个能否改成递归, 并在指定层级退出循环
@littleylv 确实不行, 我想要的是在 "2017-06-09" - 1 - 1 这层停止, 但是打印出来的结果还有再下一层的数据,  loop($dataArr, 1, 2); 是这样调用你代码吧?
2017-07-26 12:24:11 +08:00
回复了 hpze2000 创建的主题 PHP 这个能否改成递归, 并在指定层级退出循环
@littleylv 不行, 数据结构是上面那种
2017-07-26 12:23:42 +08:00
回复了 hpze2000 创建的主题 PHP 这个能否改成递归, 并在指定层级退出循环
``` json
{"2017-06-09":{"1":{"1":{"1009":[["2017-06-09","1","1","1009","58950.0"]],"1013":[["2017-06-09","1","1","1013","56313.0"]],"1014":[["2017-06-09","1","1","1014","28712.0"]],"1018":[["2017-06-09","1","1","1018","28066.0"]],"1019":[["2017-06-09","1","1","1019","21876.0"]],"1024":[["2017-06-09","1","1","1024","1726.0"]]},"2":{"1009":[["2017-06-09","1","2","1009","155460.0"]],"1013":[["2017-06-09","1","2","1013","161308.0"]],"1014":[["2017-06-09","1","2","1014","85232.0"]],"1018":[["2017-06-09","1","2","1018","76618.0"]],"1019":[["2017-06-09","1","2","1019","86616.0"]],"1024":[["2017-06-09","1","2","1024","20397.0"]]},"3":{"1009":[["2017-06-09","1","3","1009","37313.0"]],"1013":[["2017-06-09","1","3","1013","21614.0"]],"1014":[["2017-06-09","1","3","1014","31182.0"]],"1018":[["2017-06-09","1","3","1018","32203.0"]],"1019":[["2017-06-09","1","3","1019","25704.0"]],"1024":[["2017-06-09","1","3","1024","4950.0"]]},"4":{"1009":[["2017-06-09","1","4","1009","13948.0"]],"1013":[["2017-06-09","1","4","1013","13140.0"]],"1014":[["2017-06-09","1","4","1014","6991.0"]],"1018":[["2017-06-09","1","4","1018","10775.0"]],"1019":[["2017-06-09","1","4","1019","7691.0"]],"1024":[["2017-06-09","1","4","1024","736.0"]]},"5":{"1009":[["2017-06-09","1","5","1009","344285.0"]],"1013":[["2017-06-09","1","5","1013","280339.0"]],"1014":[["2017-06-09","1","5","1014","237754.0"]],"1018":[["2017-06-09","1","5","1018","223571.0"]],"1019":[["2017-06-09","1","5","1019","219879.0"]],"1024":[["2017-06-09","1","5","1024","25673.0"]]},"6":{"1009":[["2017-06-09","1","6","1009","96828.0"]],"1013":[["2017-06-09","1","6","1013","103464.0"]],"1014":[["2017-06-09","1","6","1014","49379.0"]],"1018":[["2017-06-09","1","6","1018","62153.0"]],"1019":[["2017-06-09","1","6","1019","39691.0"]],"1024":[["2017-06-09","1","6","1024","5976.0"]]}},"2":{"1":{"1009":[["2017-06-09","2","1","1009","573576.0"]],"1013":[["2017-06-09","2","1","1013","558571.0"]],"1014":[["2017-06-09","2","1","1014","323552.0"]],"1018":[["2017-06-09","2","1","1018","304721.0"]],"1019":[["2017-06-09","2","1","1019","320235.0"]],"1024":[["2017-06-09","2","1","1024","50228.0"]]},"2":{"1009":[["2017-06-09","2","2","1009","97358.0"]],"1013":[["2017-06-09","2","2","1013","84935.0"]],"1014":[["2017-06-09","2","2","1014","57710.0"]],"1018":[["2017-06-09","2","2","1018","37856.0"]],"1019":[["2017-06-09","2","2","1019","59515.0"]],"1024":[["2017-06-09","2","2","1024","12598.0"]]},"3":{"1009":[["2017-06-09","2","3","1009","14631.0"]],"1013":[["2017-06-09","2","3","1013","15582.0"]],"1014":[["2017-06-09","2","3","1014","12144.0"]],"1018":[["2017-06-09","2","3","1018","12527.0"]],"1019":[["2017-06-09","2","3","1019","14618.0"]],"1024":[["2017-06-09","2","3","1024","1859.0"]]},"4":{"1009":[["2017-06-09","2","4","1009","8131.0"]],"1013":[["2017-06-09","2","4","1013","3090.0"]],"1014":[["2017-06-09","2","4","1014","7888.0"]],"1018":[["2017-06-09","2","4","1018","7041.0"]],"1019":[["2017-06-09","2","4","1019","5873.0"]],"1024":[["2017-06-09","2","4","1024","1054.0"]]},"5":{"1009":[["2017-06-09","2","5","1009","197357.0"]],"1013":[["2017-06-09","2","5","1013","168221.0"]],"1014":[["2017-06-09","2","5","1014","141942.0"]],"1018":[["2017-06-09","2","5","1018","159086.0"]],"1019":[["2017-06-09","2","5","1019","145580.0"]],"1024":[["2017-06-09","2","5","1024","16738.0"]]},"6":{"1009":[["2017-06-09","2","6","1009","11851.0"]],"1013":[["2017-06-09","2","6","1013","8199.0"]],"1014":[["2017-06-09","2","6","1014","7198.0"]],"1018":[["2017-06-09","2","6","1018","6964.0"]],"1019":[["2017-06-09","2","6","1019","5844.0"]],"1024":[["2017-06-09","2","6","1024","-151.0"]]}}}}
```
2017-07-26 11:32:31 +08:00
回复了 hpze2000 创建的主题 PHP 这个能否改成递归, 并在指定层级退出循环
function loop($data) {
if (!is_array($data)) return;

foreach ($data as $key1 => $da1) {
echo $key1 . ": " . count($da1) . "\n";
loop($da1);

// 这样递归, 怎么在 第三层的时候跳出 总共可能有 10 层
}
}
2017-07-26 11:12:06 +08:00
回复了 hpze2000 创建的主题 PHP 这个能否改成递归, 并在指定层级退出循环
foreach ($dataArr as $key1 => $da1) {
echo 'lay1 * ' . $key1 . ": " . count($da1) . "\n";
foreach ($da1 as $key2 => $da2) {
echo 'lay2 * ' . $key2 . ": " . count($da2) . "\n";
foreach ($da2 as $key3 => $da3) {
echo 'lay3 * ' . $key3 . ": " . count($da3) . "\n";

// 可能有无限极, 能在指定层这里跳出循环
}
}
}
这种云测试, 是怎么实现的 ?
2015-06-08 16:22:45 +08:00
回复了 skyline75489 创建的主题 分享创造 Deck —— 使用 React Native 实现的 Github 客户端
楼主 这个坑帮我看看啥问题。
$ react-native init AwesomeProject
This will walk you through creating a new React Native project in /Users/johnson/AwesomeProject
npm WARN engine [email protected]: wanted: {"node":"~0.10"} (current: {"node":"0.12.4","npm":"2.10.1"})

[email protected] install /Users/johnson/AwesomeProject/node_modules/react-native/node_modules/ws
(node-gyp rebuild 2> builderror.log) || (exit 0)

初始化项目的时候, 一直卡在那, 是需要翻墙么??
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   976 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 21ms · UTC 20:27 · PVG 04:27 · LAX 12:27 · JFK 15:27
Developed with CodeLauncher
♥ Do have faith in what you're doing.