Code works locally, but gives: expects parameter to be array, boolean given when run online
<p>I have used some code from <a href="http://aterribleidea.com/3d10/3d10-simple-blackjack-dealer.txt" rel="nofollow">this</a> blackjack game to build my own full version.</p>

<p>Everything works perfectly locally using Xampp, but when I uploaded the full version I get: expects parameter to be array, boolean given.</p>

<p>I'm very new to PHP, but from what I understand, I have defined the array.  Why is it giving me a boolean online, and array offline?</p>

<p>Here is the <a href="http://torontothenaughty.ca/Toronto/Testing_Different_Things/Dice/BlackJackDealer.php" rel="nofollow">full game</a>  I wrote.(the site is a little NSFWish, but the page is clean)</p>

<p>The problem seems to be from here:</p>

<pre><code>function evaluateHand($hand) {
$Ace=0;
global $faces;
$value = 0;
foreach ($hand as $card) {
    if ($card['face'] == 'Ace') 
        $Ace++;

 $value = intval($value) + intval($faces[$card['face']]);

   while ($Ace&gt;0 &amp;&amp; $value &gt;21)
        {
            $value = intval($value) - 10;
            $Ace--;
        }

}
</code></pre>

<p>specifically the -  foreach ($hand as $card) { part.</p>

<p>I do remember reading someone else having the same problem, and the solution seemed to be switiching from double to single quotations here.</p>

<pre><code>&lt;input type='hidden' name='handstr' value = '&lt;?php echo $handstr ?&gt;' /&gt;
</code></pre>

<p>but I already have single quotations.</p>

<p>What really confuses me, is the guy who wrote the script seems to have it running fine.</p>

<p>If you change the .PHP to .txt you can see the full game code (from link above... sorry 2 link max)</p>

<p>Anyone know why offline would be different from online, and how to fix the problem?</p>
