in_array always returns false

green green grass

I have this function:

function remove_addresse($input) {
    if (!is_array ($input)) {
        $input = array ($input);
    }

    foreach ($this -> message_meta['to_address'] as $key => $address) {
        echo $address;
        print_r($input);
        if (in_array ($address, $input)) {
            unset ($this -> message_meta['to_address'][$key]);
       }
    }
}

For some reason in_array is always returning false.

typical $address: [email protected]

typical $input: Array ( [0] => mult1.client.com [1] => mult3.client.com )

Why is this happening?

Ronni Skansing

Unless the . is a typo in the typicial input, well then the needle is not in the haystack.

[email protected] != mult3.client.com

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related