企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
### 1.最多两位小数的金额 ``` function checkMoney($price){ if(strpos($price, '.') !== false){ # 小数,最多两位小数 $preg = '/^(([0-9]\.[1-9])|([0-9]\.[0-9][1-9])|([1-9][0-9]*\.[1-9])|([1-9][0-9]*\.[0-9][1-9]))$/'; }else{ # 整数 $preg = '/^(([0-9])|([1-9][0-9]*))$/'; } if(preg_match($preg, $price)){ return true; } return false; } ```