|
Page 1 of 1 |
sTo0z
[Moderator] Babysitter
Posts: 7449
Location: USA
|
Posted: Mon, 8th Aug 2005 19:30 Post subject: *SOLVED* PHP Yet Again!!! -Multidimensional arrays- |
|
 |
Code: | for( $i = 0; $i < $individuals; $i++ )
{
for( $j = 0; $j < $features; $j++ )
{
$var = mt_rand( 0, 1 );
$population[i][j] = $var;
}
}
for( $i = 0; $i < $individuals; $i++ )
{
for( $j = 0; $j < $features; $j++ )
{
echo $population[i][j];
}
} |
Alright, got that code goin on, I'm trying to fill that multi dimensional array with 1's and 0's.
The random # is generating fine, and the element of the array WHEN IT GOES IN is fine, but when I loop through and print it out, it's either ALL 1's or ALL 0's.
Can someone help me out? I would forever be in your debt.
EDIT:
Yah I'm a fool and forgot a few $'s in my arrays, damn variables... I'm soooooooooo tired. Time for bed. 
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
sTo0z
[Moderator] Babysitter
Posts: 7449
Location: USA
|
Posted: Tue, 9th Aug 2005 15:56 Post subject: |
|
 |
Dreamweaver 
|
|
Back to top |
|
 |
Page 1 of 1 |
All times are GMT + 1 Hour |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group
|
|
 |
|