Update php.html.markdown

Moved to group with associative arrays.
This commit is contained in:
Patrick Lee 2016-02-18 16:30:21 -05:00
parent e0f31275a1
commit a5ae0795ba

View File

@ -142,13 +142,13 @@ $associative = ['One' => 1, 'Two' => 2, 'Three' => 3];
echo $associative['One']; // prints 1 echo $associative['One']; // prints 1
// Add an element to an associative array
$array['Four'] = 4;
// List literals implicitly assign integer keys // List literals implicitly assign integer keys
$array = ['One', 'Two', 'Three']; $array = ['One', 'Two', 'Three'];
echo $array[0]; // => "One" echo $array[0]; // => "One"
// Add an element to an associative array
$array['Four'] = 4;
// Add an element to the end of an array // Add an element to the end of an array
$array[] = 'Four'; $array[] = 'Four';
// or // or