0
点赞
收藏
分享

微信扫一扫

php 判断变量是否为价格类型(金额/货币:6.02)有小数点

罗蓁蓁 2022-07-27 阅读 57


$t1='60'; //错误的,这是字符串
$t=6.0;
if(is_numeric($t)){
echo '是价格';
}else{
echo '不是';
}

线上测试网址:

​​https://www.runoob.com/try/runcode.php?filename=demo_string_echo&type=php​​

举报

相关推荐

0 条评论