public static function array_prev_element($arr, $nested_key, $iteration = 1)
    {
        foreach ($arr as $key => $v) {
            if ($key == $nested_key) {
                for ($i = 0; $i < $iteration; $i++) {
                    $return = prev($arr);
                }

                if (!empty($return)) {
                    return $return;
                } else {
                    return false;
                }
            }

            next($arr);
        }

        return false;
    }
public static function array_prev_element($arr, $nested_key, $iteration = 1)
    {
        foreach ($arr as $key => $v) {
            if ($key == $nested_key) {
                for ($i = 0; $i < $iteration; $i++) {
                    $return = prev($arr);
                }

                if (!empty($return)) {
                    return $return;
                } else {
                    return false;
                }
            }

            next($arr);
        }

        return false;
    }
public static function array_prev_element ( $ arr , $ nested_key , $ iteration = 1 ) { foreach ( $ arr as $ key => $ v ) { if ( $ key == $ nested_key ) { for ( $ i = 0 ; $ i < $ iteration ; $ i ++ ) { $ return = prev ( $ arr ) ; } if ( ! empty ( $ return ) ) { return $ return ; } else { return false ; } } next ( $ arr ) ; } return false ; }
return the prev element of a specific key

@param $arr
@param $nested_key
@param int $iteration
@return bool|mixed
return the prev element of a specific key