Hello,
We are having problem with Arrays that is best described with code example:
the array is: $country_array
now when we check on the COUNT of items in this array or print them out, the CORRECT count & items are listed as per example:
echo '<p>country count: ’ . count($country_array);
for ($i = 0; $i < count($country_array); ++$i) {
echo ‘<br>’ . $country_array[$i];
}
printing our: 5
And:
United States
United Kingdom
Australia
Canada
Germany
However when we do this:
if (isset($country_array) AND (in_array(‘United States’, $country_array))) {
echo ‘<p>United States’; }
if (isset($country_array) AND (in_array(‘United Kingdom’, $country_array))) {
echo ‘<p>United Kingdom’; }
if (isset($country_array) AND (in_array(‘Australia’, $country_array))) {
echo ‘Australia’; }
etc.
it ONLY prints out:
United States
and not the other matching items of this array!
WHAT the HEK is going on?
ThanX.