Home >Backend Development >PHP Tutorial >分享一则PHP定义函数代码_php技巧

分享一则PHP定义函数代码_php技巧

WBOY
WBOYOriginal
2016-05-16 20:22:36901browse

先贴代码

复制代码 代码如下:

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

这是表格的标题

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

这是一段 PHP  定义函数的代码

tips:

1、注意PHP 的语法格式

2、注意在PHP 中插入Html 代码的方式

3、利用for 循环的时候,注意想清楚,外部循环和里部循环 的差异性

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