Re: converting a multi-decisional array
| From: | Ken Robinson | Date: | Thu, 29 Apr 2021 22:03:33 +0000 |
| Subject: | Re: converting a multi-decisional array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327552@lists.php.net to get a copy of this message | ||
Your current code works fine. I put your code into a test program and there
are no errors. The error must be elsewhere in your code.
<?php
$row =
['sda_day_number'=>1,'sda_start'=>time(),'sda_end'=>time()+100000,'order_id'=>1234];
$pstart = 1;
$pend = 2;
$order_id = '1234';
$avs[$row['sda_day_number']][] =
array(
'dn' => $row['sda_day_number'],
'start' => date('g:i a',
strtotime($row['sda_start'])),
'end' => date('g:i a',
strtotime($row['sda_end'])),
'pstart' => $pstart,
'pend' => $pend,
'order_id' => $row['order_id']
);
print_r($avs);
Ken