Hi, basically I'm trying to get the PHP to check that $bookPrice (an input field) is either one or two numbers, a dot, then two numbers (13.99 or 3.99). At the moment it checks the correct amount of numbers, but works allows either a . to be entered or not (so it allows 1399).
Any help would be good
Thanks
oh forgot to add, it works if the price is only one number (3.99/399) but not if its (13.99/1399)PHP Code:if (preg_match("/^[0-9]{1,2}.[0-9]{2}/", $bookPrice) === 0) { $error[] = "The price did not contain a decmimal place.";}







Reply With Quote
