title: Using ajax to call php and return multiple variables?
body: <p>I am trying to use javascript to call a php script which then will return multiple variables back to my javascript so I can manipulate them.</p>
  
  <p>This is my JS.</p>
  
  <pre><code>                $.ajax({ 
                      url: 'test.php',
                      data: { id : lastFileId },
                      success: function(output) {
                          alert(output);
                      }
                  });
  </code></pre>
  
  <p>my PHP</p>
  
  <pre><code>&lt;?php
      $fileId = ($_GET['id']);
      $num1 = 1;
      $num2 = 2;
  
  ?&gt;
  </code></pre>
  
  <p>From here, how can I return variables $num1 and $num2 so i can use them in my javascript. Is it possible?</p>
  
  <p>also this is a very basic idea of what I have planned to do if I can achieve this.</p>