43 coaches online • Server time: 18:07
* * * Did you know? There are 420446 active teams in FUMBBL.
Log in
Recent Forum Topics goto Post Finishing the 60 Gam...goto Post TSC Draftgoto Post 4,000TV!
[X] Praying Help Please
foreach
#7
Gutter Runner
MA
9
ST
2
AG
4
AV
7
R
0
B
0
P
0
F
0
G
6
Cp
0
In
0
Cs
1
Td
9
Mvp
2
GPP
39
XPP
0
SPP
39
Injuries
n
Skills
Dodge
Block
Dauntless
Side Step
PHP 4 introduced a foreach construct, much like Perl and some other languages. This simply gives an easy way to iterate over arrays. foreach works only on arrays, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes; the second is a minor but useful extension of the first:

foreach (array_expression as $value)
statement
foreach (array_expression as $key => $value)
statement

The first form loops over the array given by array_expression. On each loop, the value of the current element is assigned to $value and the internal array pointer is advanced by one (so on the next loop, you'll be looking at the next element).

The second form does the same thing, except that the current element's key will be assigned to the variable $key on each loop.

Note: When foreach first starts executing, the internal array pointer is automatically reset to the first element of the array. This means that you do not need to call reset() before a foreach loop.

Note: Also note that foreach operates on a copy of the specified array and not the array itself. Therefore, the array pointer is not modified as with the each() construct, and changes to the array element returned are not reflected in the original array. However, the internal pointer of the original array is advanced with the processing of the array. Assuming the foreach loop runs to completion, the array's internal pointer will be at the end of the array.

As of PHP 5, you can easily modify array's elements by preceding $value with &. This will assign reference instead of copying the value.
Match performances
Date
Opponent
Comp
TD
Int
Cas
Mvp
Spp
2004-08-13
-
1
-
-
1
8
2004-08-13
-
2
-
-
-
6
2004-08-16
-
3
-
-
-
9
2004-08-19
-
1
-
1
-
5
2004-08-20
-
2
-
-
1
11