unemployment Posted February 12, 2011 Share Posted February 12, 2011 I know I can do this.... foreach ($conversations as $conversation) but can I do this foreach ($conversations as $conversation and $messages as $message) Let me know. I need both of these in my for loop. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted February 12, 2011 Share Posted February 12, 2011 You can't do that in a foreach() loop. Quote Link to comment Share on other sites More sharing options...
AtomicRax Posted February 12, 2011 Share Posted February 12, 2011 If you are certain the two arrays have the same number of records and you're simply trying to get the corresponding information from both of them at once, you can try something like this: for ($x = 0; $x<count($conversations); $x++) { $conversation = $conversations[$x]; $message = $messages[$x]; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.