php - Not sure the loop I need to use every two variables -
i have problem have array $user.
i have $_session['players'] has total amount of $user.
i need function can take user1 , 2 , use them. move on user3 , 4 , use them, , on.. until have used players. total $user[$i] players-1.
anyone have solution this? thanks
would suit needs? requires there number of players work though, unless stick in check odd numbers:
for ($i = 0; $i < $_session['players']; $i += 2) { $usera = $user[$i]; $userb = $user[$i + 1]; // things $usera , $userb variables... }
Comments
Post a Comment