title: PHP: use value from an array in an if statement within a function
body: <p>I have the following code which works fine inline with my code:</p>
  
  <pre><code>    if ($progressData[1] == "yes") {
  
          echo "Complete";
      }
      else
  
          echo "Not Yet Complete";
  </code></pre>
  
  <p>However, I would like to call it from a function:</p>
  
  <pre><code>function progressOutput () {
  
      if ($progressData[1] == "yes") {
  
          echo "Complete";
      }
      else
  
          echo "Not Yet Complete";
  
  }   
  </code></pre>
  
  <p>When I call <code>progressOutput()</code>, I get "Not Yet Complete", even though <code>$progressData[1]</code> is equal to "yes".</p>
  
  <p>Here is how I am calling the function:</p>
  
  <pre><code>Mission Status: &lt;?php progressOutput(); ?&gt;
  </code></pre>
  
  <p>What do I need to do to get <code>progressOutput()</code> to return "Complete" when <code>$progressData[1]</code> is in fact equal to "yes"?</p>