PHP Dynamic Implementation Table cross-row cross-column implementation code _php tutorial

Source: Internet
Author: User
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 "








";}function Baobiao_danteng ($name, $time _unit, $pro _name, $pre _name) {echo " "; for ($i = 0; $i < $time _unit; $i + +) {echo " ";for ($j = 0; $j < (COUNT ($pro _name)-1), $j + +) {echo " ";for ($i = 0; $i < $time _unit; $i + +) {echo "
" . $col 1_name. " " . $col 2_name. " " . $col 3_name. "
$name " . $pro _name[0]. "" . $pre _name. $i. "";
}
echo "
" . $pro _name[($j + 1)]. "" . $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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.