Home >Backend Development >PHP Tutorial >Share a PHP definition function code, php definition function_PHP tutorial

Share a PHP definition function code, php definition function_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:06:18720browse

Share a PHP definition function code, php definition function

Post the code first

Copy code The code is as follows:

Function table(){
echo "";
echo "";
for($out=0; $out < 10; $out++ ){
               $bgcolor = $out%2 == 0 ? "#ffffff" : "green";
$fontcolor = $out%2 == 0 ? "#ffffff" : "#000000";
echo "";
for($in=0;$in<10;$in++){
                        echo "";
            };
echo "";
        };
echo "

This is the title of the table

".($out*10+$in)."
";
}
table();
?>

This is a piece of PHP code that defines functions

tips:

1. Pay attention to the syntax format of PHP

2. Pay attention to the way of inserting Html code in PHP

3. When using for loop, be careful to think clearly about the difference between the outer loop and the inner loop

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/960704.htmlTechArticleShare a PHP definition function code, php definition function first paste the code and copy the code as follows: php function table() { echo "table align='center' border='1' width='600' cellspacing='0';...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn