Gossamer Forum
Home : General : Internet Technologies :

PHP Foreach problems :(

Quote Reply
PHP Foreach problems :(
Argh..this is really getting me annyed! I have the following code;

Code:
echo "$exploded[1] and $product<BR>";
if ($exploded[1] == $product) {

echo "comparing $exploded[1] and $product";

// need to readd to the cookie...
$put_into_array .= "||$exploded[0]::$exploded[1]::$exploded[2]";

} else { $found = 1; skip; echo $found . "<BR>"; } // if it is found, then set $found to 1...

Now, if the item being removed was found, then $found should be assigned with 1, and then it gets skipped. However, it is not matching for some reason! I am echoing the contents of both variables to see what is being compared, and from what is being printed out, I would think it should work. Here is what I'm seeing;

Quote:
64645646 and 64645646
1
somethingh yerer and 64645646
1

Now, the first one should have $found set to 1, which it is, but the second one should not be set at all Unimpressed Can anyone see anything silly with this code that I'm just not seeing?

Thanks

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!