Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Help mga ka sb sa php

lightkira8

Apprentice
Advanced Member
Messages
74
Reaction score
0
Points
26
Good morning mga ka sb pa help naman po pano ko gagawin multiplication table without using multiplication symbol (*) ang output nya dapat yung nasa picture salamat po sa tutulong
 

Attachments

  • output.png
    output.png
    3.6 KB · Views: 4
USING PHP

Baka may mas madali pa dito, peru sa ngayun yan ang alam ko na madali.

See the preview online -> https://eval.in/883137
View attachment 328296

<?php

$arraynum = [1,2,3,4,5];
$arrayincrement = [1,2,3,4,5];

echo "<table border='1'>";
for($i=0; $i<count($arraynum); $i++)
{
if($i>0)
{
$arraynum[0]+=$arrayincrement[0];
$arraynum[1]+=$arrayincrement[1];
$arraynum[2]+=$arrayincrement[2];
$arraynum[3]+=$arrayincrement[3];
$arraynum[4]+=$arrayincrement[4];
}
echo "<tr>";
echo "<td>".$arraynum[0]."</td><td>".$arraynum[1]."</td><td>".$arraynum[2]."</td>
<td>".$arraynum[3]."</td><td>".$arraynum[4]."</td>";
echo "</tr>";

}
echo "</table>";
?>




Same output


https://eval.in/883140

<?php

$arraynum = [1,2,3,4,5];

echo "<table border='1'>";
for($i=0; $i<count($arraynum); $i++)
{
if($i>0)
{
$arraynum[0]+=$arraynum[0]/$i;
$arraynum[1]+=$arraynum[1]/$i;
$arraynum[2]+=$arraynum[2]/$i;
$arraynum[3]+=$arraynum[3]/$i;
$arraynum[4]+=$arraynum[4]/$i;
}
echo "<tr>";
echo "<td>".$arraynum[0]."</td><td>".$arraynum[1]."</td><td>".$arraynum[2]."</td>
<td>".$arraynum[3]."</td><td>".$arraynum[4]."</td>";
echo "</tr>";

}
echo "</table>";
?>
 

Attachments

  • sample.png
    sample.png
    18.6 KB · Views: 3
Last edited:
Nasagot ko na ito dun sa nauna mong post: See answer here

Code:
<table>
	<?php
		for($x = 1; $x <= 10; $x++){ // this loop is for the number of rows
			echo '<tr>';
			for($y = 1; $y <= 10; $y++){ // this loop is for the number of columns
				$answer = 0;
				for($z = 1; $z <= $y; $z++){ $answer += $x; } // this loop adds the value of the rows repeatedly, simulating a multiplication process
				echo '<td style="width: 10%; text-align: center;">' . $answer . '</td>';
			}
			echo '</tr>';
		}
	?>
</table>
 
Last edited:
Back
Top Bottom