title: Sending/receiving string from PHP to Python
body: <p>I'm running two Python scripts from my PHP code. To send the values to the scripts I'm doing:</p>
  
  <pre><code>$output1 = shell_exec('python /path/to/my/script1.py '.$name);
  $output1 = explode(',', $output1);
  </code></pre>
  
  <p>and then I'm doing:</p>
  
  <pre><code>$output2 = shell_exec('python /path/to/my/script2.py '.$output1[0]);
  $output2 = explode(',', $output2);
  </code></pre>
  
  <p><code>$output1</code> receives the return from the python script correctly but <code>script2.py</code> is returning me a wrong value. Manually setting that value of <code>$output1[0]</code> directly on <code>script2.py</code> gives me a correct value so the problem is not the script.</p>
  
  <p>I already did a <code>echo var_dump($output1);</code> and it's giving me a correct <code>$output1[0]</code>, so the problem is neither the value coming from <code>$output1</code>.</p>
  
  <p>Any clues?</p>
  
  <p>Edit1: the value of <code>$output1[0]</code> is a string with white spaces ("Green Day").</p>
  
  <p>Edit2: seems like it's passing just the word "Green". When I pass a string that has a white space, only the first word is passed. That doesn't make sense since I'm exploding by ',' and when I echo the <code>$output1</code> it shows me the correct string with the white space included.</p>