函数原型
bool_from_yn( string $yn ): bool
函数描述
Determines whether input is yes or no.
是否弃用
未弃用
函数参数
-
$yn
string
Required - Character string containing either
'y'(yes) or'n'(no).
函数返回值
bool True if 'y', false on anything else.
函数位置
File: wp-includes/functions.php.
函数源码
function bool_from_yn( $yn ) {
return ( 'y' === strtolower( $yn ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |

