3

This is generated through php(just an example. Can be bigger than this.) How do I put this in only one array? So, that i can pass it to view and output in same format.

Name: abc       Address: xyz
Title   Paid
ABC     $100
CDE     $200

Name: rrt       Address: adf
Title   Paid
VDF     $140
CEE     $400

Name: xcv       Address: fdfs
Title   Paid
RET     $120
SSD     $430
2
  • 2
    And how did you generated this Commented Jun 9, 2015 at 7:33
  • It is created in a nested foreach loop. I am trying to convert a pre-existing code which is written in one file(in codeigniter) into mvc format. This is written in codeigniter. Commented Jun 9, 2015 at 7:37

1 Answer 1

2
$output = array(
    array(
        'name'=>'abc',
        'address'=>'xyz',
        'data'=>array(
            array(
                'title'=>ABC,
                'paid'=>100
            ),
            array(
                'title'=>CDE,
                'paid'=>200
            )
        )
    )
);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.