Share a PHP definition function code_PHP tutorial

WBOY
Release: 2016-07-13 10:06:03
Original
866 people have browsed it

Share a PHP defined function code

This article mainly introduces sharing a PHP defined function code, mainly to familiarize everyone with the syntax format of PHP and the insertion in PHP HTML code, I hope it can give you some help.

Post the code first

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 code that defines functions in PHP

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/961081.htmlTechArticleSharing a PHP defined function code This article mainly introduces sharing a PHP defined function code, mainly to let Everyone is familiar with the syntax format of php and the way to insert HTML code in php...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template