This section actually tells the truth and there is no dry food, but in order to prevent the PO Master lazy cancer Recurrence, or stick to put something, even the content and length are heinous. This section is implemented by a function to display the contents of the array in the table label of the output HTML.
function files--createtables.php file:
<?PHP//convert data in array to the element displayed in HTML ' s table tagfunctionCreate_tables ($DATAARR,$border=1,$cellpadding=4,$cellspacing=2,$bgcolor= "#FFFFFF"){ Echo"<table border=\" ".$border. "\" Cellpadding=\ "".$cellpadding. "\" Cellspacing=\ "".$cellspacing. "\" Bgcolor=\ "".$bgcolor. "\""; Reset($DATAARR); $value= Current($DATAARR); while($value){ Echo"<tr><td>".$value. "</tr></td>"; $value=Next($DATAARR); } Echo"</table>";}//Create the spam data for displaying$DATAARR=Array("Apple", "pear", "orange");//Call the functionCreate_tables ($DATAARR, 2, 4, 2, "#CCCCCC");?>
Display effect:
Revised on 2016/3/9 by Mustang fungus
PHP self-taught 4--using functions to output array data to an HTML table tag (use the example of a function)