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