title: validate white spaces in a string using php
body: <p>Validate the user entered in textbox that contains only white spaces.</p>
  
  <pre><code>$str = ' ';
  $str2 = " abc @ def &lt;etc&gt;";
  </code></pre>
  
  <p>I need to validate the above two strings ,that returns an output for $str is false and $str2 is true.</p>