* @since 1.0 */ class CDoc { # 3.通过数组生成html文档样式 /* $array = [ 'title' => '1111', 'description' => 'xxxxxxxxxxxx', 'content' => [ ['aaa','bbbb'], ['aaaaa','bbbbbbbbb'], ], ]; */ public static function tableformat($array){ $t_str = ''; $content = $array['content']; $i = 0; if(is_array($content) && !empty($content)){ foreach($content as $d){ $i++; if($i == 1){ $t_str .=''; if(is_array($d) && !empty($d)){ foreach($d as $v){ $t_str .=''.$v.''; } } $t_str .=''; }else{ if($i == 2) $t_str .=''; $t_str .=''; if(is_array($d) && !empty($d)){ foreach($d as $v){ $t_str .=''.$v.''; } } $t_str .=''; } } $t_str .=''; } $str = '
'.$array['title'].'
'.$array['description'].'
'.$t_str.'

'; return $str; } }