Home > Backend Development > PHP Tutorial > 循环不知道原因结束

循环不知道原因结束

WBOY
Release: 2016-06-13 13:29:03
Original
751 people have browsed it

求助 循环不知道原因结束

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
         $ss = array();
         foreach($data[0] as $key => $val ){
             preg_match('/<a href="(%5B%5E" preg_match src="(%5B%5E">(.*)/isU',$val,$title);
             preg_match('/<strong>(.*)/isU',$val,$tuanPrice);
             preg_match('/<li>原价:(.*)元/isU',$val,$yuanPrice);
             preg_match('/class="L_F_2">(.*)折/isU',$val,$zheShu);
             preg_match('/class="a7">(.*)/isU',$val,$webName);
             preg_match('/\'(.*)\'/isU',$val,$time);
             $src_a = 'http://www.nduotuan.com'.$src[1];
             $ss[] = array($title[1],$href[1],$src_a,$tuanPrice[1],$yuanPrice[1],$zheShu[1],$time[1],$webName[1]);
             //echo "<pre class="brush:php;toolbar:false">";print_r($ss);
             $html='';
         }
         echo "<pre class="brush:php;toolbar:false">";print_r($ss);


Copy after login


有这样一个循环, 有80条记录,我在循环外打应数组,不出结果,根本没有执行到循环外面
我在循环里打赢数组,结果输出的值,只能循环在53条记录,就结束循环了。程序也不执行了。


------解决方案--------------------
用dump或dump_var显示一下各相关变量的值吧
------解决方案--------------------
鼠标右键看看是否被浏览器注释掉了?
------解决方案--------------------
为什么不考虑打印data[0]看看呢?
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template