I want to move element of array present at 1st index to the 5th index in the array. How can I do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you really mean “move”, than that can be something like this
Cant test it, but the idea is: We take and remove the Element at
$fromfrom the original array, than we split the rest at$toand merge all together. Maybe some index inarray_slice()does not match exactly;)