xProteuSx Posted December 13, 2007 Share Posted December 13, 2007 How would I go about limiting a value to a numerical string? Is there a predefined function for this? Link to comment https://forums.phpfreaks.com/topic/81437-solved-form-input-limited-to-numbers-only/ Share on other sites More sharing options...
revraz Posted December 13, 2007 Share Posted December 13, 2007 is_numeric() Link to comment https://forums.phpfreaks.com/topic/81437-solved-form-input-limited-to-numbers-only/#findComment-413399 Share on other sites More sharing options...
sKunKbad Posted December 13, 2007 Share Posted December 13, 2007 or use (int) Link to comment https://forums.phpfreaks.com/topic/81437-solved-form-input-limited-to-numbers-only/#findComment-413400 Share on other sites More sharing options...
CMC Posted December 13, 2007 Share Posted December 13, 2007 Or a regular expression, but revraz's post is the easiest way Link to comment https://forums.phpfreaks.com/topic/81437-solved-form-input-limited-to-numbers-only/#findComment-413433 Share on other sites More sharing options...
xProteuSx Posted December 13, 2007 Author Share Posted December 13, 2007 Thanks. I've got is_numeric() working now. Link to comment https://forums.phpfreaks.com/topic/81437-solved-form-input-limited-to-numbers-only/#findComment-413442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.