From a5ae0795ba9e947b6b766707a0b93e5032ba8615 Mon Sep 17 00:00:00 2001 From: Patrick Lee Date: Thu, 18 Feb 2016 16:30:21 -0500 Subject: Update php.html.markdown Moved to group with associative arrays. --- php.html.markdown | 6 +++--- 1 file 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 -- cgit v1.2.3