PHP function to print table in HTML -
It is quite easy to use PHP to generate HTML code to display a table (which has the same length of arrays Is an array of), for example, the code below I was thinking though: is this a PHP function for you? I searched php in the Table to print the code: Print table on Google and searched the PHP manual on the table but could not find such a function.
$ result2 = mysql_query (show the 'Columns'. Can not show columns from $ table) or die (' . '$ Table); If (mysql_num_rows ($ result2)) {echo '& lt; Table cellpadding = "0" cellspacing = "0" class = "db-table"> gt; '& Lt echo; TR & gt; & Lt; Th & gt; Field & lt; / Th & gt; & Lt; Th & gt; & Lt; / Th & gt; & Lt; Th & gt; Null & lt; / Th & gt; & Lt; Th & gt; Key & lt; / Th & gt; & Lt; Th & gt; Error & lt; Th & gt; Extra & lt; / Th & gt; & Lt; / TR & gt; '; While ($ row2 = mysql_fetch_row ($ result2)) {echo '& lt; Tr & gt; '; Foreach ($ line as $ 2 = key = & gt;) {echo '& lt; TD & gt; ', $ value,' & lt; / TD & gt; '; } Echo & lt; / Tr & gt; '; } Echo '& lt; / Table & gt; & Lt; Br / & gt; '; }
There is no such underlying function. You made your own, similarly it works. There is always var_dump (), but it is not readable for your average visitor.
Comments
Post a Comment