php自定义函数的语法格式

Posted 代码写春秋

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php自定义函数的语法格式相关的知识,希望对你有一定的参考价值。

表格

<?php


function table(){

  echo ‘<table border="1" width="456" align="center">‘;
  echo ‘<caption><h1>表格</h1></caption>‘;

for ($i=0; $i <=10 ; $i++) {
  $bg = ($i%2==0)?"#ccccccc":"";
  echo ‘<tr bgcolor="‘.$bg.‘">‘;
    for ($j=0; $j <=10 ; $j++) {
      echo "<td>".($i*10+$j)."</td>";
  }

    echo "</tr>";
  }
    echo "</table>";
}

table();











以上是关于php自定义函数的语法格式的主要内容,如果未能解决你的问题,请参考以下文章