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... Link to comment https://forums.phpfreaks.com/topic/24968-help-in-checking-value-patterns/ 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] Link to comment https://forums.phpfreaks.com/topic/24968-help-in-checking-value-patterns/#findComment-113814 Share on other sites More sharing options...
elioncho Posted October 25, 2006 Author Share Posted October 25, 2006 thanks!!! :D thank you very much Link to comment https://forums.phpfreaks.com/topic/24968-help-in-checking-value-patterns/#findComment-113959 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.