<?php
// Define tasks and subtasks with unique batch numbers
$tasks = array(
array(
'batch_number' => 'B001',
'task' => 'Task 1',
'subtasks' => array(
array('subtask_number' => 'B001-S001', 'subtask' => 'Subtask 1.1'),
array('subtask_number' => 'B001-S002', 'subtask' => 'Subtask 1.2'),
array('subtask_number' => 'B001-S003', 'subtask' => 'Subtask 1.3')
)
),
array(
'batch_number' => 'B002',
'task' => 'Task 2',
'subtasks' => array(
array('subtask_number' => 'B002-S001', 'subtask' => 'Subtask 2.1'),
array('subtask_number' => 'B002-S002', 'subtask' => 'Subtask 2.2')
)
)
);
// Display tasks and subtasks with batch numbers
foreach ($tasks as $task) {
echo $task['task'] . " (Batch Number: " . $task['batch_number'] . "):<br/>";
foreach ($task['subtasks'] as $subtask) {
echo "- " . $subtask['subtask'] . " (Batch Number: " . $subtask['subtask_number'] . ")<br/>";
}
echo "<br/>";
}
?>
0 Comments