douheng8629 2013-03-31 01:59 采纳率: 100%
浏览 81
已采纳

PHP中的foreach数量有限吗?

I don't know is it right or not. I have a PHP file with contents like this:

$x = explode("
", $y); // Making $x has length 65000
foreach ($x as $k) {
    //Some code here
}

And often my script auto-stopping after ~25000 loops. Why? Is it PHP default configuration?

  • 写回答

3条回答 默认 最新

  • dr9379 2013-03-31 02:12
    关注

    This behaviour can be because of 2 reasons

    1. The script execution time is more than allocated to it ... Try increasing max_execution_time in php.ini .

    2. The memory limit of script may be more than allocated .For this try changing the value of memory_limit in php.ini

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部