diff options
author | Patrick Lee <me@patricklee.nyc> | 2016-02-18 15:59:00 -0500 |
---|---|---|
committer | Patrick Lee <me@patricklee.nyc> | 2016-02-18 15:59:00 -0500 |
commit | 663f6e28f54a106204b9656d7a1ece1e9f225bcf (patch) | |
tree | 35f62a7209d8a475c768b708b5e2bed52ae37086 /php.html.markdown | |
parent | a08051109f623b8708700bfde5b27f4366d54b39 (diff) |
Update php.html.markdown
Added reference to add an element to an associative array.
Diffstat (limited to 'php.html.markdown')
-rw-r--r-- | php.html.markdown | 3 |
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 |