I have a form that gives me multiple arrays when submit. My question is if there is a smart way to echo out (to show the user) all the arrays instead of doing a foreach for each array?
Could a solution be to do a function with a foreach loop?
HTML from the TASKS input:
<td><input type="checkbox" name="tasks[<?php echo($value[0]);?>]"value=<?php echo($key[0]);?>></td>
My PHP script:
if(isset($_POST['submit'])) {
$tasks = $_POST['tasks'];
$user = $_POST['user'];
$pickup_at = $_POST['pickup_at'];
$message = $_POST['message'];
$price = $_POST['price'];
$part_missing = $_POST['part_missing'];
Foreach ex. on the TASKS array
foreach($tasks as $key => $keys)
{
echo $key ."<br>";
}