summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam Bard <github@adambard.com>2016-02-18 14:40:56 -0800
committerAdam Bard <github@adambard.com>2016-02-18 14:40:56 -0800
commita2848909baba1812556b6d4fb55052fa2455dcc5 (patch)
treeb1739fb943869107e071481eefda0e14c6a5ac14
parent2768288bf8e5202b18083ddc88583487e7f80090 (diff)
parentc50ff1ddc874ace092507982f881510b27a2e173 (diff)
Merge pull request #2144 from patleeman/master
[php/en] Update 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..6944390c 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -142,6 +142,9 @@ $associative = ['One' => 1, 'Two' => 2, 'Three' => 3];
echo $associative['One']; // prints 1
+// Add an element to an associative array
+$associative['Four'] = 4;
+
// List literals implicitly assign integer keys
$array = ['One', 'Two', 'Three'];
echo $array[0]; // => "One"