0

In the MySQL table, I have 3 column which is tour_from, tour_to, and pickup.

I have saved these value as json_encode formate.

tour_from

[["one","three","five"],["seven","nine","eleven"],["thirteen","fifteen","seventeen"]]

tour_to

[["two","four","six"],["eight","ten","twelve"],["fourteen","sixten","eighteen"]]

pickup

[["01:00","01:00","01:00"],["01:00","01:00","01:00"],["01:00","01:00","01:00"]]

Now I want to output the these as below:

one        two       01:00
thre       four      01:00
five       six       01:00
seven      eight     01:00
nine       ten       01:00
eleven     twelve    01:00
thirteen   fourteen  01:00
fifteen    sixteen   01:00
seventeen  eighteen  01:00

I can output the tour_from value but can't output the other 2 column value

$from             =  json_decode($data['tour_from'], true);
$to               =  json_decode($data['tour_to'], true);
$pickup           =  json_decode($data['pickup'], true);

foreach ($from[$gKey] as $key1 => $value1) {

$html .=<<<EOD
    <tr>
        <td>From</td>
        <td>$value1</td>
        <td>To</td>
        <td>$to[$gKey][$key1]</td>
        <td>Pickup</td>
        <td></td>
    </tr>

EOD;    
}

My head is going to break but can't find the way :(

Visual Output:

enter image description here

Shibbir
  • 1,963
  • 2
  • 25
  • 48

0 Answers0