title: PHP Echo array outside function
body: <p>I'm curious to know how to echo an array outside a function, for instance, this code prints it within. but what if I just wanted to return the values and echo it outside?</p>
  
  <pre><code>function myArray() {
      $arr = array('One', 'Two', 'Three', 'four');
  
      for ($i = 0; $i &lt; count($arr); $i++) {
          echo $arr[$i];
      }
  }
  
  myArray();
  </code></pre>
  
  <p>Hope that makes sense.</p>