教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 Warning: Invalid argument supplied for foreach()

Warning: Invalid argument supplied for foreach()

发布时间:2019-03-29   编辑:jiaochengji.com
教程集为您提供Warning: Invalid argument supplied for foreach()等资源,欢迎您收藏本站,我们将为您提供最新的Warning: Invalid argument supplied for foreach()资源
你是不是在用foreach 时出现这样的错误呢?Warning: Invalid argument supplied for foreach()

语法:foreach(array as value => value2)

实例:

$Array =array(1,2,3,4);

$Temp = false;

foreach( $Array as $out =>$temp){

    echo $temp;

}

这样就会输出1234

下面我们再来看一个foreach的实例吧。

foreach( $Trray as $out =>$temp){

    echo $temp;

}

会出错:

Warning: Invalid argument supplied for foreach() in E:wwwrootshinywwwrootincludesmodulesshippingems.php on line 92

哈哈,你应该知道为什么会出现上面的错误了吧。

www.111cn.net/phper/php.html原创转载注明

您可能感兴趣的文章:
Warning: Invalid argument supplied for foreach()
PHP出现Warning: scandir()问题的解决方法
Warning: mysql_free_result():
Warning: mysql_fetch_array():
Warning: Missing argument 3 for
Apache Reference Manual (12)
php file_get_contents抓取https地址报错的解决办法
php编码与中文乱码问题解决方法
php 完美解决无法上传大文件方法
有关php中文乱码的解决方法

[关闭]
~ ~