mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 07:33:57 +00:00
Update php.html.markdown
Added reference to add an element to an associative array.
This commit is contained in:
parent
a08051109f
commit
663f6e28f5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user