咨询电话:010-82823766

yha,你要的用正则表达式判断输入的数字是否合法的例子。
  • 2007-12-27 10:08:13
  • 发表时间:
  • 浏览次数:
  • 不详
  • 文章来源:
  • 佚名
  • 作者:

<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>

top
推荐导读
推荐导读
bottom
top
热门文章
热门文章
bottom