Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $customerInfo = [
- [
- 'name'=>'Mahfuj',
- 'address'=>'Rangpur',
- 'contact'=>[
- 'phone'=> [
- 01737355454,
- +25454554,
- 65445454
- ],
- 'email'=>[
- 'demo@gmail.com',
- 'demo2@gmail.com',
- 'demo3@gmail.com'
- ],
- 'social_media'=>[
- "fb"=>'fb123',
- 'tw'=>'twit652',
- 'linkdin'=>'linkdin321'
- ]
- ]
- ],
- [
- 'name'=>'Jamal',
- 'address'=>'Dhaka',
- 'contact'=>[
- 'phone'=> [
- 01737355454,
- +25454554,
- 65445454
- ],
- 'email'=>[
- 'demo@gmail.com',
- 'demo2@gmail.com',
- 'demo3@gmail.com'
- ],
- 'social_media'=>[
- "fb"=>'fb123',
- 'tw'=>'twit652',
- 'linkdin'=>'linkdin321'
- ]
- ]
- ],
- [
- 'name'=>'Kamal',
- 'address'=>'Dinajpur',
- 'contact'=>[
- 'phone'=> [
- 01737355454,
- +25454554,
- 65445454
- ],
- 'email'=>[
- 'demo@gmail.com',
- 'demo2@gmail.com',
- 'demo3@gmail.com'
- ],
- 'social_media'=>[
- "fb"=>'fb123',
- 'tw'=>'twit652',
- 'linkdin'=>'linkdin321'
- ]
- ]
- ],
- [
- 'name'=>'Ashib',
- 'address'=>'Kurigram',
- 'contact'=>[
- 'phone'=> [
- 01737355454,
- +25454554,
- 65445454
- ],
- 'email'=>[
- 'demo@gmail.com',
- 'demo2@gmail.com',
- 'demo3@gmail.com'
- ],
- 'social_media'=>[
- "fb"=>'fb123',
- 'tw'=>'twit652',
- 'linkdin'=>'linkdin321'
- ]
- ]
- ],
- [
- 'name'=>'Ratan',
- 'address'=>'Rangpur',
- 'contact'=>[
- 'phone'=> [
- 01737355454,
- +25454554,
- 65445454
- ],
- 'email'=>[
- 'demo@gmail.com',
- 'demo2@gmail.com',
- 'demo3@gmail.com'
- ],
- 'social_media'=>[
- "fb"=>'fb123',
- 'tw'=>'twit652',
- 'linkdin'=>'linkdin321'
- ]
- ]
- ],
- [
- 'name'=>'Miraj',
- 'address'=>'Dinajpur',
- 'contact'=>[
- 'phone'=> [
- 01737355454,
- +25454554,
- 65445454
- ],
- 'email'=>[
- 'demo@gmail.com',
- 'demo2@gmail.com',
- 'demo3@gmail.com'
- ],
- 'social_media'=>[
- "fb"=>'fb123',
- 'tw'=>'twit652',
- 'linkdin'=>'linkdin321'
- ]
- ]
- ],
- [
- 'name'=>'Hehedi',
- 'address'=>'Dhaka',
- 'contact'=>[
- 'phone'=> [
- 01737355454,
- +25454554,
- 65445454
- ],
- 'email'=>[
- 'demo@gmail.com',
- 'demo2@gmail.com',
- 'demo3@gmail.com'
- ],
- 'social_media'=>[
- "fb"=>'fb123',
- 'tw'=>'twit652',
- 'linkdin'=>'linkdin321'
- ]
- ]
- ]
- ];
- echo '<table border style="border-collapse:collapse">';
- echo '<tr>
- <th>Name</th>
- <th>Address</th>
- <th>Contact</th>
- </tr>';
- foreach ($customerInfo as $key1 => $value1) {
- echo '<tr>';
- foreach ($value1 as $key2 => $value2) {
- if (is_array($value2)) {
- echo '<td><table border style="border-collapse:collapse">';
- foreach ($value2 as $key3 => $value3) {
- echo '<tr>';
- $i = 1;
- echo '<th>'.$key3.'</th>';
- foreach ($value3 as $key4 => $value4) {
- if(is_array($value4)){
- if ($i == count($value4)) {
- echo '<th>'.ucwords(str_replace('_', ' ', $key3)).'</th>';
- }
- }
- echo '<td>'.$value4.'</td>';
- $i++;
- }
- echo '</tr>';
- }
- echo '</table></td>';
- } else {
- echo '<td>'.$value2.'</td>';
- }
- }
- echo '</tr>';
- }
- echo '</table>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement