Posting Checkbox Array Comes Up Empty

The problem I’m having is that when checkboxes are checked (more than one), the message is suppose to list them in an array separated by a comma. But, when I receive the message, there is no array, just the response:

2. What are your plans for this dog? None selected

I see where ‘None selected’ comes from, but if there are checked boxes, and the statement is true, why am I not receiving them in the array?

I have the following:

$plansfordog = isset($plansfordog) ? $plansfordog : array('None selected');

$message .= ' 2. What are your plans for this dog? ' .implode(', ', $plansfordog). "\\r\
\\r\
";
<input type="checkbox" name="plansfordog[]" value="Member of the family" id="familymember" <?php
			$OK = isset($_POST['plansfordog']) ? true : false;
			if ($OK && isset($error) && in_array('Member of the Family', $_POST['plansfordog'])) { ?> checked="checked"
			<?php } ?> />
<label for="familymember">Member of the family</label><br />

<input type="checkbox" name="plansfordog[]" value="Pet" id="pet" <?php
			if ($OK && isset($error) && in_array('Pet', $_POST['plansfordog'])) { ?> checked="checked"
			<?php } ?> />
<label for="pet">Pet</label><br />
<input type="checkbox" name="plansfordog[]" value="Best Friend" id="bestfriend" <?php
			if ($OK && isset($error) && in_array('Best Friend', $_POST['plansfordog'])) { ?> checked="checked"
			<?php } ?> />
			<label for="bestfriend">Best Friend</label><br />

Thank you for looking at this for me.

You should be checking for $_POST[‘plansfordog’] existing, not $plansfordog

But isn’t that what I have here:

<?php
$OK = isset($_POST[‘plansfordog’]) ? true : false;
if ($OK && isset($error) && in_array(‘Member of the Family’, $_POST[‘plansfordog’])) { ?> checked=“checked”
<?php } ?>

I’m talking about your PHP code at the top, which produces the output you wanted to change. It is only looking at $plansfordog which is never set to anything.

OH! Gottcha! Yep! Found it!

WOOHOO! It worked!