Below are lines of my code. I have a foreach loop to print values into a table. It results in an error saying
"Parse error: syntax error, unexpected 'endforeach' (T_ENDFOREACH)"
I can't seem to figure out where I have gone wrong.
<?php foreach (getStaffDetails() as $staffDetails):
if($staffDetails['admin_confirm'] == 1)
{?>
<tr>
<td><?php echo $staffDetails['name']; ?></td>
<td> <?php echo $staffDetails['staff_id']; ?></td>
<td> <?php $dept= $staffDetails['dept_id'];
$dept_name= getDeptName($dept);
echo $dept_name;?> </td>
<td> <?php echo $staffDetails['email_id']; ?></td>
<td> <?php echo $staffDetails['ph_no']; ?></td>
<td> <?php echo $staffDetails['gender']; ?></td>
<td> <?php echo $staffDetails['doj']; ?></td>
<?php endforeach; ?>