ldoozer Posted August 23, 2010 Share Posted August 23, 2010 I am trying to validate a field to see if its empty or not and using: if(strlen($company)<1){ this works fine but if someone adds a space character it lets is through. Is there a way to catch this? Link to comment https://forums.phpfreaks.com/topic/211540-validation-rule/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 23, 2010 Share Posted August 23, 2010 If space characters are not to be permitted at the start of the data, the end of the data, or as the whole data, the easiest method would be to use trim on the data. Link to comment https://forums.phpfreaks.com/topic/211540-validation-rule/#findComment-1102831 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.