Dynamic create rows and colum with the help of PHP and HTML

前端 未结 5 1683
面向向阳花
面向向阳花 2021-01-01 02:17

I want to create dynamic rows and column with the help of PHP and HTML but I am little confused about this code so some help is definitely appreciated.

&l         


        
5条回答
  •  天命终不由人
    2021-01-01 02:39

    Do something like this:

      foreach ($data as $ord => $db_data)
      {
          if (($ord == count($data) - 1) && (count($data) % 2))
          {
              // Do a colspan of 2, as it is the last item (first clause)
              // and there are an odd number of items (second clause)
          }
      }
    

提交回复
热议问题