Home > Backend Development > PHP Tutorial > Example of using regular expressions to determine whether the entered number is legal_PHP Tutorial

Example of using regular expressions to determine whether the entered number is legal_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-20 11:03:48
Original
1085 people have browsed it



    Untitled


$in="2344";
if(ereg("^(-{0,1}|+{0,1})[0-9]+(.{0,1}[0-9]+)$",$in))
    echo "Ok!";
else
    echo "Sorry,Please input again!";
?>

很简单的嘛!




www.bkjia.comtruehttp://www.bkjia.com/PHPjc/445265.htmlTechArticlehtml head titleUntitled/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很简单的嘛! /bo...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template