The result is an array ([0] = 4)
In a logical sense, the assignment operator does not take place until the Array_splice function is finally completed.
Then Array_splice ($arr 2,1,1) Gets the value within the array $arr2 should be (3,4),
Then the operation "=", then get the contents of the $ARR1 array should be (3,4), but actually run the entire
$arr 1 = array_splice ($arr 2,1,1), but the contents of the $ARR1 array are (4), solved.
------to solve the idea----------------------
The number in the handbook is clear: Returns an array containing the removed cells
Array_splice ($arr 2,1,1) is equivalent to Array_slice ($arr 2,1,1) only from the returned results
But the former has changed the original state of $arr 2.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.