summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPatrick Lee <me@patricklee.nyc>2016-02-18 15:59:00 -0500
committerPatrick Lee <me@patricklee.nyc>2016-02-18 15:59:00 -0500
commit663f6e28f54a106204b9656d7a1ece1e9f225bcf (patch)
tree35f62a7209d8a475c768b708b5e2bed52ae37086
parenta08051109f623b8708700bfde5b27f4366d54b39 (diff)
Update php.html.markdown
Added reference to add an element to an associative array.
-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