Share a PHP-defined function code. Share a PHP-defined function code. the php-defined function is first pasted with the code to copy the code as follows: phpfunctiontable () {echotablealigncentercellspacing0; share a PHP-defined function code. php-defined functions
Post code first
The code is as follows:
<? Php
Function table (){
Echo"
";Echo"
This is the table title.
";For ($ out = 0; $ out <10; $ out ++ ){$ Bgcolor = $ out % 2 = 0? "# Ffffff": "green ";$ Fontcolor = $ out % 2 = 0? & Quot; # ffffff & quot;: & quot; #000000 & quot ";Echo"
";For ($ in = 0; $ in <10; $ in ++ ){Echo"
| ". ($ Out * 10 + $ in )." | ";};Echo"
";};Echo"
";
}
Table ();
?>
This is a PHP-defined function code.
Tips:
1. pay attention to the PHP syntax format
2. Note the Html code insertion method in PHP.
3. when using the for loop, consider the differences between the external loop and the internal loop.
Paste the code below: php function table () {echo "table align = 'center' border = '1' width = '000000' cellspacing = '0 ';...