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..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