PHP is_bool()函数

本文概述

通过使用此函数, 我们可以检查变量是否为布尔变量。

句法

bool is_bool ( mixed $var )

参数

Parameter Description 是强制性的
var_name 正在评估的变量。 compulsory

退货

如果var为布尔值, 则返回True, 否则返回False。

例子1

<?php
	$x=false;
	echo is_bool($x);
?>

输出

PHP变量处理is_bool()函数

例子2

<?php
	$y=false;
	if (is_bool($y))
	echo 'This is a boolean type.';
	else
	echo 'This is not a boolean type.';
?>

输出

PHP变量处理is_bool()函数

来源:

https://www.srcmini02.com/29413.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_37948.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?