From 663f6e28f54a106204b9656d7a1ece1e9f225bcf Mon Sep 17 00:00:00 2001 From: Patrick Lee Date: Thu, 18 Feb 2016 15:59:00 -0500 Subject: Update php.html.markdown Added reference to add an element to an associative array. --- php.html.markdown | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3