summaryrefslogtreecommitdiffhomepage
path: root/php.html.markdown
diff options
context:
space:
mode:
authorPatrick Lee <me@patricklee.nyc>2016-02-18 16:11:17 -0500
committerPatrick Lee <me@patricklee.nyc>2016-02-18 16:11:17 -0500
commite0f31275a1086f2c61b36415f5dfa15aa7771cff (patch)
tree35f62a7209d8a475c768b708b5e2bed52ae37086 /php.html.markdown
parenta08051109f623b8708700bfde5b27f4366d54b39 (diff)
parent663f6e28f54a106204b9656d7a1ece1e9f225bcf (diff)
Merge pull request #1 from patleeman/patleeman-patch-php
[php/en] Update php.html.markdown
Diffstat (limited to 'php.html.markdown')
-rw-r--r--php.html.markdown3
1 files changed, 3 insertions, 0 deletions
diff --git a/php.html.markdown b/php.html.markdown
index ce178a15..0be8b427 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -146,6 +146,9 @@ echo $associative['One']; // prints 1
$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