PHP array help getting a value from the key

Posted by sea_1987 on Stack Overflow See other posts from Stack Overflow or by sea_1987
Published on 2010-04-15T14:51:25Z Indexed on 2010/04/15 14:53 UTC
Read the original article Hit count: 322

Filed under:
|
|

I have a variable that looks likes this,

$rslt['expected_salary_level']

This returns a string similar to LEVEL_3, in another array that looks like this I have a set of salaries,

    Array
(
    [LEVEL_1] => Array
        (
            [nice_name] => under £10,000
            [low] => 1
            [high] => 10000
        )

    [LEVEL_2] => Array
        (
            [nice_name] => £10,000 - £15,000
            [low] => 10000
            [high] => 15000
        )

    [LEVEL_3] => Array
        (
            [nice_name] => £15,000 - £20,000
            [low] => 15000
            [high] => 20000
        )

    [LEVEL_4] => Array
        (
            [nice_name] => £20,000 - £25,000
            [low] => 20000
            [high] => 25000
        )

    [LEVEL_5] => Array
        (
            [nice_name] => £25,000 - £30,000
            [low] => 25000
            [high] => 30000
        )

    [LEVEL_6] => Array
        (
            [nice_name] => £30,000 - £40,000
            [low] => 30000
            [high] => 40000
        )

    [LEVEL_7] => Array
        (
            [nice_name] => £40,000 - £50,000
            [low] => 40000
            [high] => 50000
        )

    [LEVEL_8] => Array
        (
            [nice_name] => £50,000 - £100,000
            [low] => 50000
            [high] => 100000
        )

    [LEVEL_9] => Array
        (
            [nice_name] => £100,000 or more
            [low] => 100000
            [high] => 9999999
        )

    [LEVEL_VOLUNTARY] => Array
        (
            [nice_name] => Voluntary
            [low] => 
            [high] => 
        )

    [LEVEL_UNSPECIFIED] => Array
        (
            [nice_name] => Not specified
            [low] => 
            [high] => 
        )

)

How do I get at the associated nice name?

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays