is_numeric();
<?php$tests = array(
"42",
1337,
"1e4",
"not numeric",
array(),
9.1
);
foreach ($testsas$element) {
if (is_numeric($element)) {
echo"'{$element}' is numeric", PHP_EOL;
} else {
echo"'{$element}' is NOT numeric", PHP_EOL;
}
}
?>结果
'42'is numeric '1337'is numeric '1e4'is numeric 'not numeric'isNOT numeric 'Array'isNOT numeric '9.1'is numeric
strtotime($time)
发卡宝是一个专业的软件卡密等虚拟商品在线交易平台,拥有多种兑换方式,费率低,结算快,正规企业平台一直稳定运营,24小时不间断提供自动发卡服务。【模板说明】试用版自带一套模板(响应式)【环境支持】PHP环境 / 200M或以上空间大小 / 开启父路径 / 设置index.php为默认首页 / 目录写入权限需要开启【数据库】MySQL【安装步骤】将文件上传至空间目录,运行“http://域名/inst
$time = '2015adsasd'; var_dump(strtotime($time)); $time1 = '2015-01-11'; var_dump(strtotime($time1));
结果
bool(false) int()
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });
以上就介绍了判断是否为数字,时间格式,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。









