This could probably sound silly, but my question is about arrays and their syntax:
Isn't redundant to declare an array with this syntax?
$data[] = array(
'ct_id' => $row->ct_id,
'association' => $row->association_name,
'designation' => $row->designation_name,
'license_number' => $row->license_number,
'license_date' => $row->license_date ? date("jS F, Y", strtotime($row->license_date)) : '',
'date_added' => date("jS F, Y", strtotime($row->date_added))
);
Should the declaration of the array be sufficient to define an array?
This code happens in a foreach loop like that:
foreach ($this->something->result() as $row) {..}
$data[]means "add new value to array named$data".array_push($data, array('ct_id' => $row->ct_id, 'association' => $row->association_name, 'designation' => $row->designation_name, 'license_number' => $row->license_number, 'license_date' => $row->license_date ? date("jS F, Y", strtotime($row->license_date)) : '', 'date_added' => date("jS F, Y", strtotime($row->date_added))));