Code: Select all
echo "Checking Color: ";
var_dump($strColor);
echo "Against: ";
var_dump($aryColors);
if (!in_array($strColor,$aryColors)) {
$aryColors[] = $strColor;
echo " ADDING \n";
} else {
echo " EXISTS \n";
}[text]Checking Color: string(6) "0e2411"
Against: array(2) {
[0]=>
string(6) "0e2319"
[1]=>
string(6) "243b31"
}
EXISTS [/text]
There is no missing code or logic between the dump of the variables and the if statement that checks for the color in the array.
Now, if I go and change it to have a third parameter of TRUE (to enable STRICT matching) it works fine???
At first I'm thinking "WTF? they are all string(6), what difference does that make...
It finally dawned on me what the problem was... Can you figure it out?