search
HomeBackend DevelopmentPHP Tutorial 循环不知道原因结束

求助 循环不知道原因结束

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 class="a8 lazy" src="/static/imghwm/default1.png" data-src="([^"></a>(.*)/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);


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


------解决方案--------------------
用dump或dump_var显示一下各相关变量的值吧
------解决方案--------------------
鼠标右键看看是否被浏览器注释掉了?
------解决方案--------------------
为什么不考虑打印data[0]看看呢?
Statement
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
php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code<form name="myform"

Match在java中的匹配方法Match在java中的匹配方法Apr 28, 2023 pm 10:31 PM

说明match用于匹配操作,其返回值为boolean类型。通过match,可以简单地验证list中是否存在某种要素。实例//验证list中string是否有以a开头的,匹配到第一个,即返回truebooleananyStartsWithA=stringCollection.stream().anyMatch((s)->s.startsWith("a"));System.out.println(anyStartsWithA);//true//验证list中string是否

jquery中val方法是干什么的jquery中val方法是干什么的Mar 25, 2023 am 11:14 AM

jquery中val方法是用于返回或设置被选元素的value属性;当用于返回值时,该方法返回第一个匹配元素的value属性的值,其语法是“$(selector).val()”;当用于设置值时,该方法设置所有匹配元素的value属性的值,其语法是“$(selector).val(value)”。

Java中如何使用正则表达式匹配字符串?Java中如何使用正则表达式匹配字符串?Apr 19, 2023 pm 02:37 PM

概念1、各种Match操作可用于判断给定的Predicate是否符合Stream的要素。2、Match操作是终端操作,返回布尔值。实例booleananyStartsWithA=stringCollection.stream().anyMatch((s)->s.startsWith("a"));System.out.println(anyStartsWithA);//truebooleanallStartsWithA=stringCollection.stream().

java Match怎么使用java Match怎么使用Apr 18, 2023 pm 01:55 PM

概念1、各种Match操作可用于判断给定的Predicate是否符合Stream的要素。2、Match操作是终端操作,返回布尔值。实例booleananyStartsWithA=stringCollection.stream().anyMatch((s)->s.startsWith("a"));System.out.println(anyStartsWithA);//truebooleanallStartsWithA=stringCollection.stream().

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题Jun 13, 2016 am 10:15 AM

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。<?phpfunction down_file($file_name,$file_sub_dir){//为防止乱码使用函数iconv$file_name=iconv("utf-8","gb2312",$file_

图片消失怎么解决图片消失怎么解决Jun 13, 2016 am 10:09 AM

图片消失如何解决先是图片文件上传$file=$_FILES['userfile'];  if(is_uploaded_file($file['tmp_name'])){$query=mysql_query("INSERT INTO gdb_banner(image_src ) VALUES ('images/{$file['name'

为什么小弟我在php上写的这个代码,在浏览器上什么都不显示为什么小弟我在php上写的这个代码,在浏览器上什么都不显示Jun 13, 2016 am 10:24 AM

为什么我在php上写的这个代码,在浏览器上什么都不显示啊<?php   if(isset($_POST['Submit'])&& $_POST['Submit']=="登陆"){   $user=$_POST['user']; $pass=$_POST['pass']; if(empt

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment