What I am trying to do is to push somme arrays into one array: The static form of my array is as following:
$Data = array
(
array('uid' => 1, 'Field Name' => 'xxxx', 'Field Values' => 'xxxx'),
array('uid' => 2, 'Field Name' => 'xxxx', 'Field Values' => 'xxxx'),
array('uid' => 3, 'Field Name' => 'xxxx', 'Field Values' => 'xxxx'),
);
I want to obtain the same Data array I tried the next, but it didnt work:
$Data = array();
// $Columns is an array that contains the Field Names
for ($i=0; $i < sizeof($Columns); $i++) {
$newelement=array('uid' =>$i, 'Field Name' => $Columns[$i], 'Field Values' => 'xxxx');
$Data = array_push($Data,$newelement);
}
Is there a better way than using array_push(); ??