您的位置:首页 > 编程语言 > PHP开发

PHP基本类型测试

2009-04-21 11:46 323 查看
源代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/xhtml1-loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title goes here</title>
</head>
<body>
<?php
$bool = TRUE;
echo "value=$bool, type=";
echo gettype($bool);
?>
<br />
<?php
$int = 1;
echo "value=$int, type=";
echo gettype($int);
?>
<br />
<?php
$double = 1.0;
echo "value=$double, type=";
echo gettype($double);
?>
<br />
<?php
$string = "This is a string";
echo "value=$string, type=";
echo gettype($string);
?>
</body>
</html>
输出:

value=1, type=boolean

value=1, type=integer

value=1, type=double

value=This is a string, type=string
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: