Table from array in PHP

January 14, 2016 ยท View on GitHub

\n"; $i = 1; foreach ( $cols as $key => $value ) { if ( !empty( $value ) ) { $i++; if ( $i % 2 === 0 ) { $content .= "" . $key . ': ' . $value . ""; } $content .= ""; if ( $i % 2 === 1 ) { $content .= ""; } } } $content .= "\n"; echo $content; }