I have an array. But trying to separate items. For example:
$array1 = ["banana","car","carrot"];
trying to push car into another array which is $array2
$push = array_push($array1, "car") = $array2;
I try to find array_push usage for this but the documentation is all about. sending new item to array. Not array to array. Is this possible with array_push or need to use something else?
I need to search for the value car
in $array1
, push it into $array2
and remove it from $array1
.