PHP Aray_search multiple function ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aphrael

    PHP Aray_search multiple function ?

    I have an array like:
    7 => 'suppr'
    15 => 'suppr'
    22 => 'suppr'
    39 => 'suppr'

    With an array_search on 'suppr', I only get '7'. I can not find the
    function for getting an array like:
    0 => 7
    1 => 15
    2 => 22
    3 => 39
    Did I miss it, or is it simply that it does not exist ?

    Aphrael, desesperate...
    --
    "La demande mondiale d’ordinateurs n’excédera pas cinq machines."
    (Thomas Watson, Fondateur d'IBM, 1945)
  • Geoff Berrow

    #2
    Re: PHP Aray_search multiple function ?

    I noticed that Message-ID: <41019c96_3@new s.bluewin.ch> from Aphrael
    contained the following:
    [color=blue]
    >Did I miss it, or is it simply that it does not exist ?[/color]

    You missed it.

    From the fine manual:

    If needle is found in haystack more than once, the first matching key is
    returned. To return the keys for all matching values, use array_keys()
    with the optional search_value parameter instead.

    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    Working...