title: Pass multiple Python variables to PHP
body: <h2><strong>HTML</strong></h2>
  
  <p>This is a form that accepts a user's input (url):</p>
  
  <pre><code>&lt;form method="post" action="/" accept-charset="utf-8"&gt;
      &lt;input type="search" name="url" placeholder="Enter a url" /&gt;
      &lt;button&gt;Go&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <h2><strong>PHP (Laravel)</strong></h2>
  
  <p>This controller stores the value of the user's input (url) into a variable for use in the python script.</p>
  
  <pre><code>$url = Input::get('url');
  $name = shell_exec('path/to/python ' . base_path() . '/test.py ' . $url);
  return $name;
  </code></pre>
  
  <h2><strong>Python</strong></h2>
  
  <p>The script passes what the user input and takes the text after a forward slash and displays it.</p>
  
  <pre><code>url = sys.argv[1]
  name = url.split('/')[-1]
  print(name)
  </code></pre>
  
  <p>Going back to the PHP, it returns the value of what was executed in the Python script. If a user inputs the url: <code>http://example.com/file.png</code> it will successfully return the string <code>file.png</code></p>
  
  <p>Everything about this works, but I'm realizing that I'm limiting myself, since the <code>shell_exec</code> command is only going to paste out the string that is returned from the python script. What do I need to do if I want to have multiple variables returned?</p>
  
  <h2><strong>Python in question</strong></h2>
  
  <pre><code>url = sys.argv[1]
  name = url.split('/')[-1]
  test = "pass this text too!"
  # ? what goes here ?
  </code></pre>
  
  <p>So the HTML page should now return <code>file.png</code> and <code>pass this text too!</code> </p>
  
  <p><strong>Am I going to need to return an array or json in the python and then extract the array/json in PHP?</strong> </p>
  
  <p><em>NOTE: I am aware of security flaws/injections in these examples, these are stripped down versions of my actual code.</em></p>