码迷,mamicode.com
首页 > 其他好文 > 详细

settype — 设置变量的类型

时间:2015-10-28 15:50:01      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:设置变量的类型

说明

bool settype ( mixed &$var , string $type )

将变量 var 的类型设置成 type

范例


Example #1 settype() 示例

<?php
$foo 
"5bar"// string
$bar true;   // boolean

settype($foo"integer"); // $foo 现在是 5   (integer)
settype($bar"string");  // $bar 现在是 "1" (string)
?>


settype — 设置变量的类型

标签:设置变量的类型

原文地址:http://duai2010.blog.51cto.com/1591629/1707193

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!