public static function getValueAtIndex($array, $index)
    {
        $value = null;

        if (abs((int) $index) == self::LAST_INDEX) {
            $index == self::LAST_INDEX ? end($array) : reset($array);
            $value = current($array);
        } elseif (isset($array[$index])) {
            $value = $array[$index];
        }

        return $value;
    }
public static function getValueAtIndex($array, $index)
    {
        $value = null;

        if (abs((int) $index) == self::LAST_INDEX) {
            $index == self::LAST_INDEX ? end($array) : reset($array);
            $value = current($array);
        } elseif (isset($array[$index])) {
            $value = $array[$index];
        }

        return $value;
    }
public static function getValueAtIndex ( $ array , $ index ) { $ value = null ; if ( abs ( ( int ) $ index ) == self :: LAST_INDEX ) { $ index == self :: LAST_INDEX ? end ( $ array ) : reset ( $ array ) ; $ value = current ( $ array ) ; } elseif ( isset ( $ array [ $ index ] ) ) { $ value = $ array [ $ index ] ; } return $ value ; }
Get the value at an index. The index can be an integer or 'first' or 'last'. If the
index doesn't exists it returns null.

@param array $array
@param mixed $index
Get the value at an index . The index can be an integer or first or last . If the index doesn t exists it returns null .