Jump to content

foreach problem?


ok

Recommended Posts

What I do to catch errors with foreach loops, is checking if the variable is actually an array. So like this:

 

<?php

$multi_winner[ $i ] = $row[ "invited_by" ];

if( is_array( $multi_winner )
{
      foreach( $multi_winner as $value )
      {
            print( "stuff" );
       }
}
?>

Link to comment
https://forums.phpfreaks.com/topic/122837-foreach-problem/#findComment-634592
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.