价格日期来自

GROUP_CONCAT(CONCAT(price, ' / ', date)) AS price_date
$r->price_date // data output:  1.00 / 2013-07-13 14:35,2.00 / 2013-07-13 14:35
@foreach($results as $r)
   <?php
       $price_n_date = explode(',',  $r->price_date);      
         foreach ($price_n_date as $value) {
           list($price,$date) = explode ('/',$value)
        // How can i compare with day and display value of the day to the column?
         }
  ?>
@endforeach

我有一个表格,在表格 Headers 中生成31列第1天到第31天 . 在tbody中,我将循环一个项目,其价格和日期将显示在第1天到第31天的日期列中,如果日期和日期列匹配则只显示值,否则将显示破折号 .

它就像出席名单,但我将根据日显示该月份项目的价格变化 .

样本输出:
enter image description here