The position of the element in {code...} $ array_one is known, for example, the position of & #039; two & #039; is 2. But in $ array_two, is the position of & #039; two and two & #039; still 2? Obviously not. What if I want to change the elements of positions 1 and 3? {Code ...}
$array_one = ['one','two','three'];$array_two = ['one'=>'one,one','two'=>'two,two','three'=>'three,three'];
$array_oneThe position of the element in is known. For example, the position of 'two' is 2.
However$array_twoIs the position of 'two, two' in 2?
Obviously not. What if I want to change the elements of positions 1 and 3?
$array_two = ['three'=>'three,three','two'=>'two,two','one'=>'one,one'];
Reply content:
$array_one = ['one','two','three'];$array_two = ['one'=>'one,one','two'=>'two,two','three'=>'three,three'];
$array_oneThe position of the element in is known. For example, the position of 'two' is 2.
However$array_twoIs the position of 'two, two' in 2?
Obviously not. What if I want to change the elements of positions 1 and 3?
$array_two = ['three'=>'three,three','two'=>'two,two','one'=>'one,one'];
Location?
It should be a subscript, And the subscript of two should be 1
The associated array of array_two is accessed with the key!
$ Array_two = array_reverse ($ array_two );
For more information about the three elements, see @ Mu.
You can also consider array_slice and add the Array (+)