php move index of a value to first position in array

Solutions on MaxInterview for php move index of a value to first position in array by the best coders in the world

showing results for - "php move index of a value to first position in array"
Beverly
14 Mar 2018
1//appending $new in our array 
2array_unshift($arr, $new);
3//now make it unique.
4$final = array_unique($arr);
5