summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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"