The $reports variable is an array that holds data from my db. An example of what may be in the array is:
Expand|Select|Wrap|Line Numbers
- Report12 Title1 2 Administrator test note Deposit made 2009-05-03 04:01:22 1 Wilma Ventura 1970-06-04
- Report12 Title1 2 Administrator test note Deposit made 2009-05-03 04:01:22 1 Jane Williams 1967-07-11
- Report12 Title1 2 Administrator test note Deposit made 2009-05-03 04:01:22 1 Jack Williams 1969-04-19
- Report12 Title1 2 Administrator test note Deposit made 2009-05-03 04:01:22 1 Bob Savana 1959-09-15
Can someone please tell me if there is a better way of doing this?
Expand|Select|Wrap|Line Numbers
- $oldarr = $reports;
- $newarr = array_splice($reports,0,1);
- foreach($newarr as $val)
- {
- // my first 8 columns will go here
- if($val['rpt_type'] == 'Report12')
- {
- foreach($oldarr as $rpt)
- {
- echo $rpt['fname'],$rpt['lname'],$rpt['dob'] . '<br>';
- }
- }
- }
- }