public/wordpress/wp-content/plugins/simple-membership/classes/class.swpm-utils.php
/*
     * Checks if the string exists in the array key value of the provided array. If it doesn't exist, it returns the first key element from the valid values.
     */
Checks if the string exists in the array key value of the provided array. If it doesn't exist, it returns the first key element from the valid values.
Checks if the string exists in the array key value of the provided array . If it doesn ' t exist it returns the first key element from the valid values .
public static function sanitize_value_by_array($val_to_check, $valid_values) {
        $keys = array_keys($valid_values);
        $keys = array_map('strtolower', $keys);
        if (in_array($val_to_check, $keys)) {
            return $val_to_check;
        }
        return reset($keys); 
    }
public static function sanitize_value_by_array ( $ val_to_check , $ valid_values ) { $ keys = array_keys ( $ valid_values ) ; $ keys = array_map ( 'strtolower' , $ keys ) ; if ( in_array ( $ val_to_check , $ keys ) ) { return $ val_to_check ; } return reset ( $ keys ) ; }
Checks if the string exists in the array key value of the provided array.
Checks if the string exists in the array key value of the provided array .
//Return he first element from the valid values