title: What is the difference between PHP echo and PHP return in plain English?
body: <p>Yes, I have googled this question and even referred to my textbook (PHP by Don Gosselin) but I seriously can't seem to understand the explanation.</p>
  
  <p>From my understanding:</p>
  
  <blockquote>
    <p>echo = shows the final result of a function</p>
    
    <p>return = returns the value from a function</p>
  </blockquote>
  
  <p>I applied both <code>echo</code> and <code>return</code> in the following functions I can't see the difference or the 'effectiveness' of using <code>return</code> instead of <code>echo</code>.</p>
  
  <pre><code>&lt;?php
  echo "&lt;h1 style='font-family:Helvetica; color:red'&gt;Using &lt;em&gt;echo&lt;/em&gt;&lt;/h1&gt;";
  function add1($x, $y){
      $total = $x + $y;
      echo $total;
  }
  echo "&lt;p&gt;2 + 2 = ", add1(2, 2), "&lt;/p&gt;";
  
  echo "&lt;h1 style='font-family:Helvetica; color:red'&gt;Using &lt;em&gt;return&lt;/em&gt;&lt;/h1&gt;";
  function add2($x, $y){
      $total = $x + $y;
      return $total;
  }
  echo "&lt;p&gt;2 + 2 = ", add2(2, 2), "&lt;/p&gt;";
  
  ?&gt;
  </code></pre>
  
  <p>Both display the result!
  What am I not understanding?</p>