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? Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/211540-validation-rule/#findComment-1102831 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.