summaryrefslogtreecommitdiffhomepage
path: root/php.html.markdown
diff options
context:
space:
mode:
authorPatrick Lee <me@patricklee.nyc>2016-02-18 16:30:21 -0500
committerPatrick Lee <me@patricklee.nyc>2016-02-18 16:30:21 -0500
commita5ae0795ba9e947b6b766707a0b93e5032ba8615 (patch)
treef9774961e746ecaa613e2daa6eb28d4274736fe3 /php.html.markdown
parente0f31275a1086f2c61b36415f5dfa15aa7771cff (diff)
Update php.html.markdown
Moved to group with associative arrays.
Diffstat (limited to 'php.html.markdown')
-rw-r--r--php.html.markdown6
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