Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- array(2) {
- [0]=>
- object(PackingListData)#6 (8) {
- ["referencia"]=>
- string(10) "27713/5294"
- ["estilo"]=>
- string(5) "14376"
- ["bultos"]=>
- string(2) "26"
- ["total_bultos"]=>
- string(2) "28"
- ["piezas_teoricas"]=>
- string(2) "27"
- ["total_piezas"]=>
- string(2) "28"
- ["pack_id"]=>
- string(1) "5"
- ["id"]=>
- string(2) "10"
- }
- [1]=>
- object(PackingListData)#7 (8) {
- ["referencia"]=>
- string(10) "27713/5294"
- ["estilo"]=>
- string(5) "14377"
- ["bultos"]=>
- string(1) "2"
- ["total_bultos"]=>
- string(2) "28"
- ["piezas_teoricas"]=>
- string(1) "3"
- ["total_piezas"]=>
- string(1) "4"
- ["pack_id"]=>
- string(1) "5"
- ["id"]=>
- string(2) "11"
- }
- }
- <?php
- header('Content-type:application/json;charset=utf-8');
- $id = 5;
- $packing = PackingListData::getPackingList($id);
- $arr = array();
- foreach ($packing as $pack) {
- $arr = array( 'id'=>$pack->id,
- 'referencia' =>$pack->referencia,
- 'estilo'=>$pack->estilo,
- 'bultos'=>$pack->bultos,
- );
- echo json_encode($arr);
- }
- {"id":"10","referencia":"27713/5294","estilo":"14376","bultos":"26"}{"id":"11","referencia":"27713/5294","estilo":"14377","bultos":"2"}
Add Comment
Please, Sign In to add comment