Hey I am trying to echo each value of the checkbox that gets checked. When I hit my submit button on the form, I get a message saying that there is an invalid argument in the foreach loop. I can't figure out what it is. Even when I check all 4 values, the array count is 0.
<form action="processRemove.php" name="removeForm">
<input type='checkbox' name='dirs[]' value='1' />
<br />
<input type='checkbox' name='dirs[]' value='2' />
<br />
<input type='checkbox' name='dirs[]' value='3' />
<br />
<input type='checkbox' name='dirs[]' value='4' />
<input type='submit' value='submit' />
</form>
<?php
$remove = $_POST['dirs'];
$removeFiles = "";
echo $remove." ";
echo count($remove);
foreach($remove as $val)
{
echo $val;
}