I want to make an array in PHP but it should be in specific format such this:
array(1, 5, 3)
I mean, I have the values 1, 5 and 3 from my database, so I had to loop it with the use of array_push
$a=array();
foreach( $db_nums as $db_num ){
array_push($a, $db_num);
}
print_r($a);
but it outputs:
Array ( [0] => 1 [1] => 5 [2] => 3 );
i want it to be only:
array(1, 5, 3 );
Any ideas how? Thanks a lot for any help!