So i have following function :
function push_to_array()
{
$array_of_data = func_get_arg(0);
for($i = 1; $i < func_num_args(); ++$i){
$array_of_data[] = func_get_arg($i);
}
return $array_of_data;
}
I can use it with existing array : $array = ['once','two','three'];
Function is used for pushing data into existing array.
So final call looks like :
$newArray = push_to_array($array,'haha','hoho','hihi');
Now i want to transform the call into
push_to_array($array,'haha','hoho','hihi');
so i dont need to create new variable or i dont want to, but i want to modify already existing array;
PS: i know there are functions like array_push but i want to learn it by myself.