博客列表 >乘法口诀2

乘法口诀2

来自星星的博客
来自星星的博客原创
2017年12月28日 17:41:50548浏览
<?php
header('content-type:text/html;charset=utf-8');
echo <<<'AA'
<form>
行: <input type="text" name="a">  列:<input type="text" name="b">
<button>确定</button>
</form>    
AA;
$a=isset($_GET['a'])?$_GET['a']:null;    $b=isset($_GET['b'])?$_GET['b']:null;
echo '<table border="0" cellpadding="5" cellspacing="0" width="600">';
for($i=1;$i<=$a;$i++){echo '<tr>';for($j=1;$j<=$b;$j++){
    if($i>=$j){echo '<td>'.($j."x".$i."=".$i*$j).'</td>';}}
echo '</tr>';}
echo '</table>';

1514457817864291.jpg

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议