Jump to content

Invalid argument


daveoliveruk

Recommended Posts

I have the following piece of code:

 

 

foreach($classRequests as $key => $val) {

 

if(is_array($val)){

foreach ($val as $key2 => $val2) {

if ($key2 == "UserID")

$strIDs2 = add2string($strIDs2, $val2, ',');

if ($key2 == "RequestedUserID")

$strIDs2 = add2string($strIDs2, $val2, ',');

}

else {

if ($key == "UserID")

$strIDs2 = add2string($strIDs2, $val, ',');

if ($key == "RequestedUserID")

$strIDs2 = add2string($strIDs2, $val, ',');

}

 

 

 

}

 

And in the logs I'm getting:

 

[Tue Feb  5 11:57:36 2008] [error] PHP Warning:  Invalid argument

supplied for foreach() in /home/public_html/menu_home.php on

line 589

 

Is tehre anyway to avoid this?

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/89571-invalid-argument/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.