Re: in_array() fails but it's in the array

From: Rasmus (razor-report_at_daimi.au.dk)
Date: 04/19/04


Date: Mon, 19 Apr 2004 17:37:58 +0200

have you tried with the proper syntax?

array_keys($boolword) = Array ( [0] => 'album',
    [1] => 'keywords',
    [2] => 'persons',
    [3] => 'events',
    [4] => 'image_alt',
    [5] => 'image_creation_start_date',
    [6] => 'image_creation_end_date',
    [7] => 'image_location_city',
    [8] => 'image_location_state',
    [9] => 'image_location_country' );

        R

-- 
Due to VERY heavy spam reception (24,000+/week), I use a fake address.
Please write me in this newsgroup if you want to get in contact with me
NEVER support spammers or companies sending out spam
NEVER use links sent to you in a spam mail
NEVER unsubscribe a spam message
NEVER reply to spam
"Phil Powell" <soazine@erols.com> wrote in message
news:1cdca2a7.0404190718.11c223a7@posting.google.com...
> [Quote]
> array_keys($boolword) = Array ( [0] => 'album' [1] => 'keywords' [2]
> => 'persons' [3] => 'events' [4] => 'image_alt' [5] =>
> 'image_creation_start_date' [6] => 'image_creation_end_date' [7] =>
> 'image_location_city' [8] => 'image_location_state' [9] =>
> 'image_location_country' )
> [/Quote]
>
> Here is my array.  Plain and simple enumerative array with values
> being strings.
>
> So why does this fail???
>
> [PHP]
> print_r(in_array('album', array_keys($boolword)));
> [/PHP]
>
> This produces FALSE or NULL.  But it's right there IN the array!! What
> on earth is going on? Is this a failure in the part of in_array() that
> I am unaware of?
>
> This is a major showstopper in my search code PHP script I'm writing
> for my application, please help someone!
>
> Thanx
> Phil


Relevant Pages

  • Re: interesting question
    ... It's to prevent spam. ... and would run on existing PCs with 8 GBytes of RAM. ... My version needs an array of size n to compute the chaotic series up to n. ...
    (comp.lang.forth)
  • Re: To moderate or not to moderate
    ... 202 postings of which less than 5% spam (I'm watching every day), ... Spam is visually immediately detected. ... I never believed that the idea of embracing the array world will have ... SQL is defenitly an array language. ...
    (comp.lang.apl)
  • Re: To moderate or not to moderate
    ... Sooner or later there will be a mechanism in place that removes spam. ... comp.lang.apl is definitely a brand. ... I never believed that the idea of embracing the array world will have ... SQL is defenitly an array language. ...
    (comp.lang.apl)
  • Selecting Components
    ... Thinking about how Ada selects components of things, especially of composite objects, I see that almost every case uses dot notation. ... Array ... However, many languages, including Pascal, Ada's ancestor, use for array ... Jeff Carter "Spam! ...
    (comp.lang.ada)
  • Re: in_array() fails but its in the array
    ... Due to VERY heavy spam reception, I use a fake address. ... NEVER unsubscribe a spam message ... "Phil Powell" wrote in message ... Plain and simple enumerative array with values ...
    (comp.lang.php)