This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:create:array [16.01.2015 11:56] – Added associative arrays admin | en:create:array [18.11.2020 17:30] (current) – [Arrays] sophia.schauer | ||
---|---|---|---|
Line 11: | Line 11: | ||
// create an array | // create an array | ||
$a = array(' | $a = array(' | ||
+ | </ | ||
+ | |||
+ | Instead of the notation '' | ||
+ | |||
+ | <code php> | ||
+ | // Create an array with square brackets | ||
+ | $a = [' | ||
</ | </ | ||
Line 37: | Line 44: | ||
<code php> | <code php> | ||
- | $a = array() | + | $a = array(); |
for ($i=0; $i<10; $i++) { | for ($i=0; $i<10; $i++) { | ||
$a[] = $i + 1; | $a[] = $i + 1; |