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

From: Paul Delannoy (delannoy_at_univ-lemans.fr)
Date: 04/19/04


Date: Mon, 19 Apr 2004 18:09:56 +0200

Phil Powell a écrit:
> [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]

What is $boolword ? it's inconsistent here, just place the name of the
array as second arg : print_r(in_array('album', array_keys));



Relevant Pages

  • Re: Awfully quiet in here lately...
    ... However, they still fail with ... PBRAIN.C by Daniel B. Cristofani ... side-effects of the array, such as array wrap-around, etc. ... expanding to a small set of basic instructions. ...
    (comp.lang.misc)
  • Re: How to arrange some numbers
    ... obvious that the only thing you need to do to test a sort function is ... return FAIL; ... void sort(int* array, int n) ...
    (comp.lang.c)
  • Re: swap method in Java
    ... >Which will only work for unsigned integer values and will still fail ... // XOR swap fail for swapping array elements if two indexes refer to ... See http://mindprod.com/jgloss/jgloss.html for The Java Glossary. ...
    (comp.lang.java.programmer)
  • Re: two dimensional arrays:
    ... pete wrote: ... >> The only way the code would fail, is if the compiler is not in full ... > is a pointer to the first element of an array of. ... > of an array of elemenents which have the same size as. ...
    (comp.lang.c)