elioncho Posted October 24, 2006 Share Posted October 24, 2006 Hi. I need to check if a value is written correctly by the user. The value consists of numbers from 1-9 and two decimal places (optional). How can I write a pattern check for this? Thanks... Quote Link to comment Share on other sites More sharing options...
Caesar Posted October 24, 2006 Share Posted October 24, 2006 [code]<?php$string = $_POST[usr_input];if(!preg_match('/[0-9]+.?[0-9]+?/',$string)) {echo'You done messed up, son';}else {echo'That\'s the thing there';}?>[/code] Quote Link to comment Share on other sites More sharing options...
elioncho Posted October 25, 2006 Author Share Posted October 25, 2006 thanks!!! :D thank you very much Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.