Blogger Information
Blog 32
fans 1
comment 0
visits 29020
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
九九乘法表 表格生成器
艾克的博客
Original
1337 people have browsed it
<?php
//九九乘法表
for($i=1;$i<10;$i++){

    for($j=1;$j<=$i;$j++){
        echo $j."*".$i."=".$j*$i." ";
    }
    echo "<br>";
}


//表格生成器
echo <<< 'INPUT'
<form>
请输入表格的行:<input type="text" name="row">列:<input type="text" name="col">
<button>提交</button>
</form>
INPUT;

$row = $_GET['row'];
$col = $_GET['col'];

echo '<table border="1" cellpadding="3" cellspacing="0" width="300">';
for ($i=0;$i<$row;$i++) {
    echo '<tr>';
    for ($j=0;$j<$col;$j++){
        echo '<td>'.($i*$col+$j).'</td>';
    }
    echo '</te>';
}
echo '</table>';


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post