Hi all, I am trying to build a “Rack builder” for military ribbons.
When I run this code all works as expected except the array($my_Ribbons) it always comes back as 1/0.
Any help? Thanks
$my_Ribbons = array ();
for ($X = 1; $X <= 32; $X += 1){
if($row_rsRibbons['Ribbion'.$X]!="0") {
echo "<img src='images/ribbions/".$X.".png' />";
echo $row_rsRibbons['Ribbion'.$X];
$B++;
$my_Ribbons[$X] = $B; <-- Trying to Append/Add $B into the array
echo $B;<-- This echos out 1,2,3,...9 Correct
}
function DivideIT($B){
echo "<BR />B=".$B."<BR />";<-- This echos out correct 9
$C = $B/4;
echo "<p>C=".$C;//<-- This echos out correct 1.25
echo "<p> my_Ribbons ".sizeof($my_Ribbons);<-- this echos out 1/0. Should be whatever $B is
}
DivideIT($B);