HOME
DOMAIN
WEB HOST
AUTO Site
VPS SERVER
CLOUD HOST
SERVER
HK HOST
AGENT
SERVICE
方法很简单PHP字符串int是很容易,只要在变量前面加个(int)就成了,转换成字符也一样的,代码如下:
$str = "10"; $num = (int)$str; // $str = "10"; $num = (int)$str; if ($str === 10) echo "string"; if ($num === 10) echo "integer"; /* 结果为 integer */ echo gettype($str); //string echo gettype($num); //integer