There is a Problem When value change of array it works but When I change second value changes made before gone because array redeclare on page loading please give a solution when I submit array value permanently change and I can change much more value of array.
</head>
<body>
<form action="table5.php" method="post">
<table border="1">
<?php
if (isset($_POST['day']) && isset($_POST['time'])){
$day=$_POST['day'];$time=$_POST['time'];
}
$cars = array(
array(0,0,0,0,0,0),
array(0,0,0,0,0,0),
array(0,0,0,0,0,0),
array(0,0,0,0,0,0),
array(0,0,0,0,0,0),
array(0,0,0,0,0,0),
array(0,0,0,0,0,0)
);
$cars[$time][$day]=1;
$time++;
$cars[$time][$day]=2;
for ($row = 0; $row < 7; $row++) {
echo "<tr>";
for ($col = 0; $col < 6; $col++) {
echo "<td>".$cars[$row][$col]."</td>";
}
echo "</tr>";
}
?><br>
</table>
day<input type="number" name="day">
time<input type="number" name="time">
<input type="submit" name="submit">
</form>
</body>