Copy CodeThe code is as follows:
< PHP
/*
* author:xudafeng@126.com
* Blog:http://www.xdf.me
* date:2012.7.28
*/
Class Danteng {
function init ($col 1_name, $col 2_name, $col 3_name, $time _unit) {
echo "
| " . $col 1_name. " |
" . $col 2_name. " |
" . $col 3_name. " |
";}function Baobiao_danteng ($name, $time _unit, $pro _name, $pre _name) {echo "
| $name |
" . $pro _name[0]. " | "; for ($i = 0; $i < $time _unit; $i + +) {echo "
" . $pre _name. $i. "";
}
echo " |
";for ($j = 0; $j < (COUNT ($pro _name)-1), $j + +) {echo "
| " . $pro _name[($j + 1)]. " | ";for ($i = 0; $i < $time _unit; $i + +) {echo "
" . $pre _name. $i. "";
}
echo "";
}
}
function Finish () {
echo "";
}
}
?>
The calling method is as follows: Copy CodeThe code is as follows:
$init = new Danteng ();
$init, init (' type ', ' Project ', ' Time unit ', $time _num);
$init->; Baobiao_danteng (' Fuxi ', $time _num, $fuxi _pro, ' pre_n ');
$init->; Baobiao_danteng (' nu wa ', $time _num, $nvwa _pro, ' unit ');
$init->; Baobiao_danteng (' Pangu ', $time _num, $pangu _pro, ' ah ');
$init->; Baobiao_danteng (' Xiao ye ', $time _num, $pangu _pro, ' egg ');
$init->; Finish ();
http://www.bkjia.com/PHPjc/326139.html www.bkjia.com true http://www.bkjia.com/PHPjc/326139.html techarticle Copy the code as follows: PHP/* * author:xudafeng@126.com * blog:http://www.xdf.me * date:2012.7.28 * * * class Danteng {function ini T ($col 1_name, $col 2_name, $col 3_name, $time _un ...
|