diff options
Diffstat (limited to 'php.html.markdown')
-rw-r--r-- | php.html.markdown | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/php.html.markdown b/php.html.markdown index 0be8b427..4acdef98 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -142,13 +142,13 @@ $associative = ['One' => 1, 'Two' => 2, 'Three' => 3]; echo $associative['One']; // prints 1 +// Add an element to an associative array +$array['Four'] = 4; + // List literals implicitly assign integer keys $array = ['One', 'Two', 'Three']; echo $array[0]; // => "One" -// Add an element to an associative array -$array['Four'] = 4; - // Add an element to the end of an array $array[] = 'Four'; // or |