<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
$in="2344";
if(ereg("^(-{0,1}|+{0,1})[0-9]+(.{0,1}[0-9]+)$",$in))
echo "Ok!";
else
echo "Sorry,Please input again!";
?>
<br>很简单的嘛!
</body>
</html>
时间: 2024-10-25 00:37:27
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
$in="2344";
if(ereg("^(-{0,1}|+{0,1})[0-9]+(.{0,1}[0-9]+)$",$in))
echo "Ok!";
else
echo "Sorry,Please input again!";
?>
<br>很简单的嘛!
</body>
</html>