Sunday, 15 June 2014

php - regular expression to match an empty (or all whitespace) string -


I want to match a string that can be any type of whitespace character (especially using PHP I'm here). Or in any way to say that a string is empty or only white space will help!

T This requires regular expression, just use:

  if (tr ($ str) === '') echo 'empty string';  

No comments:

Post a Comment