I have an array I am passing from a form on aprevious page.
When the script below executes it does not seem to actually count the array during the if condition.
The echo lines above return elements of the array to see if they exist.
echo $purch_items[0];
echo $purch_items[1];
echo $purch_items[2];
echo $purch_items[3];
echo $purch_items[4];
function recap()
{
if (count($purch_items)< 1)
{
?>
<td valign="top" align="center"><br>
<?
echo "You must select an item from the previous page to purchase. <br>";
echo "<a href=\"javascript:history.go(-1)\">Back to Package Selection</a>";
?>
</td>
<?
}
This code should continue with the else statement (not shown since the above if statement ALWAYS executes) instead it shows the array items which i entered and gives the:
You must select an item from the previous page to purchase.
Back to Package Selection
What did I do wrong?