title: Why a function checking if a string is empty always returns true?
body: <p>I have a function isNotEmpty which returns true if the string is not empty and false if the string is empty. I've found out that it is not working if I pass an empty string through it. </p>
  
  <pre><code>function isNotEmpty($input) 
  {
      $strTemp = $input;
      $strTemp = trim($strTemp);
  
      if(strTemp != '') //Also tried this "if(strlen($strTemp) &gt; 0)"
      {
           return true;
      }
  
      return false;
  }
  </code></pre>
  
  <p>The validation of the string using isNotEmpty is done:</p>
  
  <pre><code>if(isNotEmpty($userinput['phoneNumber']))
  {
      //validate the phone number
  }
  else
  {
      echo "Phone number not entered&lt;br/&gt;";
  }
  </code></pre>
  
  <p>If the string is empty the else doesn't execute, I don't understand why, can someone please shed some light on this please.</p>