title: foreach loop returns only one item from the array
body: <p>I have an array that I loop through with for each loop it returns only the first iteration but if I change it to echo it prints all of them to the screen, new to PHP not sure why is it acting this way tried looking for an answer but did not find one. the code below: </p>
  
  <pre><code>    function getData($values){
          foreach ($values as $key =&gt; $value){
              return "&lt;p&gt;". $key . " " . $value ."&lt;/p&gt;&lt;/br&gt;";
  
          }
  
      }
  
      $SubmitedResult-&gt;SerialisedForm = getData($data);
  </code></pre>