title: Check if multi-word string in if statement
body: <p>How can I check if a string is a multi word sentence or just a single word?</p>
  
  <p>I tried by splitting by a space so if it is one word, there will be only one word in the array and if there is more, then they will all be in the array.</p>
  
  <p>But, when I try to split by a space and run through that array, I am getting no output.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>$input = "the quick brown fox jumped over the lazy dog";
  
  $sentence = explode(" ", $input);
  
  foreach($sentence as $item){
      echo $item;
  }
  </code></pre>
  
  <p>The above is giving me no output.</p>
  
  <p>So, I have 2 questions:</p>
  
  <ol>
  <li>How can I detect if a string is composed of multiple words in an if statement?</li>
  <li>Why isn't my above code splitting the sentence into an array with the words? </li>
  </ol>