![]() |
FOREACH function for dummies
Help jog this dummy's memory please :D
Code:
Array I want to find out the details of the first element of the main array ( [15] ) using a foreach statement, how would I do it ? PHP Code:
However I only want (Tim and Karl printed). How can I amend the above code ? Thanks :) |
foreach() will run through each option of the array (allthough I don't think it will go into subarrays...)
If you only want to fetch the data for tim and carl, you'd have to add an if{} statement to check if the arrays key is 15. Or, in your example, just drop the first foreach and make the second into: foreach($guyscache[15] AS $value) {} |
All times are GMT. The time now is 11:18 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|