array_push does not return an array but modifiy the array passed as parameter 1
array1 contains what you want.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Why is this not adding the new idnum of 2 to the end of the array?
$idnum = 2;
$array01 = Input::get('user_ids');
$array02 = array_push($array01, $idnum);
$finalarray = array_keys($array02);
Please or to participate in this conversation.