in_array() fails but it's in the array

From: Phil Powell (soazine_at_erols.com)
Date: 04/19/04


Date: 19 Apr 2004 08:18:24 -0700


[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: Split Strings Inside of Array Class/Instance Variables Not Parsing
    ... Say you want to define an instance variable as an array, ... PHP: 5.2.11 ... > Now tell me what's not constant about gluing two strings ... If you can't initialize it to a real constant, then you must use the constructor. ...
    (comp.lang.php)
  • Re: Need help on PHP for MPE/ix
    ... Here is the syntax of the dbupdate intrinsic in PHP: ... assoc array of item values) ... Please let me know if you have any more suggesstions to solve this problem. ... Pavan Kumar Rati wrote: ...
    (comp.sys.hp.mpe)
  • Re: Need help on PHP for MPE/ix
    ... If one item is an array, it must be declared as such in the list ... So, please show us the declaration of the record buffer, and its ... Of Pavan Kumar Rati ... Need help on PHP for MPE/ix ...
    (comp.sys.hp.mpe)
  • Re: Using a RegEx as a "variable" WITHIN an array?
    ... believe the PHP one is also based upon. ... combination of 1 or more numerics in this instance would give you your ... add this to your array - you could then do a pattern match on the array ... > Dim selCriteria as String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: attempting to return values from array from w/in a function
    ... What I get is an array w/ only the most recent array entry. ... I am new to PHP & do not have formal scripting ... you end up comparing strings, but the test you mean probably is simply: ... case 1: {codeblock} ...
    (comp.lang.php)