How can i check to see if a string only contains spaces?
if (strlen(trim($str)) == 0)
or if you don't want to include empty strings,
if (strlen($str) > 0 && strlen(trim($str)) == 0)
548k questions
547k answers
4 comments
86.3k users