Home  >  Article  >  Backend Development  >  Warning: Invalid argument supplied for foreach()_PHP教程

Warning: Invalid argument supplied for foreach()_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:52:341884browse

Did you get such an error when using foreach? Warning: Invalid argument supplied for foreach()

Did you get such an error when using foreach? Warning: Invalid argument supplied for foreach()

Syntax: foreach(array as value => value2)

Example:

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

$Temp = false;

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

echo $temp;

}

This will output 1234

Let’s look at another example of foreach.

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

echo $temp;

}

Error will occur:

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

Haha, you should know why the above error occurs.

www.111cn.cn/phper/php.html original reprinted note

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632470.htmlTechArticleDid you get such an error when using foreach? Warning: Invalid argument supplied for foreach() Did you get such an error when using foreach? Warning: Invalid arg...
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