mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Update php.html.markdown
Moved to group with associative arrays.
This commit is contained in:
parent
e0f31275a1
commit
a5ae0795ba
@ -142,13 +142,13 @@ $associative = ['One' => 1, 'Two' => 2, 'Three' => 3];
|
||||
|
||||
echo $associative['One']; // prints 1
|
||||
|
||||
// Add an element to an associative array
|
||||
$array['Four'] = 4;
|
||||
|
||||
// List literals implicitly assign integer keys
|
||||
$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