title: AJAX jQuery PHP Return Value
body: <p>I am new to AJAX and am kind of confused by what PHP passes back to the jQuery.
  So you have an AJAX function like this:</p>
  
  <pre><code> $.ajax({ url: '/my/site',
       data: {action: 'test'},
       type: 'post',
       success: function(output) {
                    alert(output);
                }
   });
  </code></pre>
  
  <p>(I took this from ajax another StackOverflow page.)</p>
  
  <p>But on various other resources they will have the success section look like this:</p>
  
  <pre><code> success: function(data) {functionfoocommandshere}
  </code></pre>
  
  <p>I am just confused as to what dictates the naming of this variable? If the PHP ultimately echoes an array:</p>
  
  <pre><code>  echo $myVar;
  </code></pre>
  
  <p>How can I get this from the AJAX?</p>