Automattic\WooCommerce\Utilities
StringUtil::is_null_or_whitespace
Check if a string is null, is empty, or has only whitespace characters (space, tab, vertical tab, form feed, carriage return, new line)
Method of the class: StringUtil{}
No Hooks.
Returns
true|false. True if the string is null, is empty, or contains only whitespace characters.
Usage
$result = StringUtil::is_null_or_whitespace( ?string $value );
- ?string $value(required)
- .
StringUtil::is_null_or_whitespace() StringUtil::is null or whitespace code WC 10.7.0
public static function is_null_or_whitespace( ?string $value ) {
return is_null( $value ) || '' === $value || ctype_space( $value );
}