I have a variable, and I need to only add it to an array if it contains something other than spaces.
Up until now I had been using $var != ''. That only covers if it’s an empty string. I need it to cover if it has spaces in it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This will check if a string contains at least one non-whitespace character. Whitespace includes spaces, newlines, tabs, etc.