craigbabe Posted April 13, 2006 Share Posted April 13, 2006 hey I have a site where you can bet on things. But people are cheating in some scripts by betting 100% or 100* or something like that..If it was called $bet = 100* ;how can I alter the string so it only outputs the 100 and not the * ? Link to comment https://forums.phpfreaks.com/topic/7280-altering-a-inputted-message/ Share on other sites More sharing options...
toplay Posted April 13, 2006 Share Posted April 13, 2006 You can use ereg and preg functions but the simplest to validate input is a numeric integer is to use:[a href=\"http://us2.php.net/manual/en/function.ctype-digit.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.ctype-digit.php[/a] Link to comment https://forums.phpfreaks.com/topic/7280-altering-a-inputted-message/#findComment-26478 Share on other sites More sharing options...
craigbabe Posted April 13, 2006 Author Share Posted April 13, 2006 So this should work for characters like Â? if (!ctype_digit($price)) {exit; } Link to comment https://forums.phpfreaks.com/topic/7280-altering-a-inputted-message/#findComment-26481 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.