PHP,
pasted
on Jan 11:
|
<?php
$return_arr = array();
$company_arr = array(
(int) 0 => array(
'id' => '19',
'group_id' => '1',
'name' => 'Harts Harts',
'address' => 'xxx NE xxxth Street',
'city' => 'Shoreline',
'state' => 'WA',
'zip' => '98155',
'country' => '',
),
(int) 1 => array(
'id' => '21',
'group_id' => '1',
'name' => 'Andy Robin',
'address' => 'xxx xxxth Ave NE',
'city' => 'Bellevue',
'state' => 'WA',
'zip' => '98004',
'country' => '',
)
);
foreach ($company_arr as &$company) {
array_push($return_arr,$company);
}
echo json_encode($return_arr);
?>
|
Output:
|
[{"id":"19","group_id":"1","name":"Harts Harts","address":"xxx NE xxxth Street","city":"Shoreline","state":"WA","zip":"98155","country":""},{"id":"21","group_id":"1","name":"Andy Robin","address":"xxx xxxth Ave NE","city":"Bellevue","state":"WA","zip":"98004","country":""}]
|
|