public static function findKeyByValue(array $elements, $value)
    {
        if ($value === 0) {
            $value = '0';
        }
        foreach ($elements as $key => $item) {
            if ($item == $value) {
                return $key;
            }
        }
        return false;
    }
public static function findKeyByValue(array $elements, $value)
    {
        if ($value === 0) {
            $value = '0';
        }
        foreach ($elements as $key => $item) {
            if ($item == $value) {
                return $key;
            }
        }
        return false;
    }
public static function findKeyByValue ( array $ elements , $ value ) { if ( $ value === 0 ) { $ value = '0' ; } foreach ( $ elements as $ key => $ item ) { if ( $ item == $ value ) { return $ key ; } } return false ; }
This method returns a key for the given value.

Example:
<code>
$array = array(
'k1' => 4,
'k2' => 'd',
'k3' => 0,
9 => 'p'
);
$key = Arrays::findKeyByValue($array, 0);
</code>
Result:
<code>
k3
</code>

@param array $elements
@param string $value
@return bool|int|string
This method returns a key for the given value .