Home  >  Article  >  Backend Development  >  PHP small multiplication table implementation code_PHP tutorial

PHP small multiplication table implementation code_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:45:36677browse

Copy code The code is as follows:

for($i=1;$i<10;$i++ )
{
for($j=1;$j<=$i;$j++)
{
$result = $i*$j;
if(strlen($result )==2)
{
echo "$j*$i=$result";
echo " ";
}
else
{
echo "$j *$i=$result";
echo " ";
}
}
echo "
";
}
?>

Write random small programs to promote my passion for php, I hope I can stick to it

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320294.htmlTechArticleCopy the code as follows: ?php for($i=1;$i10;$i++) { for($ j=1;$j=$i;$j++) { $result = $i*$j; if(strlen($result)==2) { echo "$j*$i=$result"; echo "" ; } else { echo "$j*$i=$result";...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn