下一篇 » « 上一篇

Figure 2-2: Experimenting with Type Conversion

作者:semirock    时间:2008-01-22    来源:http://444p.com    点击:182795    本文共1篇文章 字体:[ ]

Figure 2-2: Experimenting with Type Conversion

<HTML>
<HEAD>
<TITLE>Figure 2-2</TITLE>
</HEAD>
<BODY>
<?
print("<B>Using settype</B><BR>\n");
$AverageTemperature = "60.5 degrees";
print("String: $AverageTemperature <BR>\n");
settype($AverageTemperature, "double");
print("Double: $AverageTemperature <BR>\n");
settype($AverageTemperature, "integer");
print("Integer: $AverageTemperature <BR>\n");
settype($AverageTemperature, "string");
print("String: $AverageTemperature <BR>\n");
print("<BR>\n");

print("<B>Using strval, intval, ");
print("and doubleval</B><BR>\n");
$AverageTemperature = "60.5 degrees";
print("String: ");
print(strval($AverageTemperature)); php学习之家
print("<BR>\n");
print("Double: ");
print(doubleval($AverageTemperature));
print("<BR>\n");
print("Integer: ");
print(intval($AverageTemperature));
print("<BR>\n");
print("String: ");
print(strval($AverageTemperature));
?>
</BODY>
</HTML>
责任编辑:semirock
发表评论
密码: (游客不需要密码)
记住我【Alt+S 或 Ctrl+Enter 快速提交】

搜索工具


《PHP函数》点击排行