mysql - PHP Loop through an array second time (foreach) -


i have foreach loop through data provided pdo sql query:

foreach ($team $row){     $count++;     $teamnumber = 'team'.$count;     if ($currentscores[0]['team'.$count] == ""){         $red = "red";     }     echo "<strong><font color='".$red."'>".$row['name']."</font></strong>";     echo $currentscores[0]['team'.$count];     if ($count < 2)          echo " vs "; } 

now, want loop again through $team array returns last value of array during second loop.

i tried same thing:

foreach ($team $row) { ..... ....... } 

how run again through array?

simple enough, foreach loop on $row have previously.

foreach($array $key => $val) {     foreach($val $a => $b) {         echo $b;     } } 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -