I tried like this: $abc = array(); foreach($_POST as $key => $value){ array_push($abc, $key => $value) } PHP: i think the problem is in 3rd line....array_push just accept a value NOT both key & value together how can i solve it or is there any other way ?? help plz