I'm running two Python scripts from my PHP code. To send the values to the scripts I'm doing:
$output1 = shell_exec('python /path/to/my/script1.py '.$name);
$output1 = explode(',', $output1);
and then I'm doing:
$output2 = shell_exec('python /path/to/my/script2.py '.$output1[0]);
$output2 = explode(',', $output2);
$output1 receives the return from the python script correctly but script2.py is returning me a wrong value. Manually setting that value of $output1[0] directly on script2.py gives me a correct value so the problem is not the script.
I already did a echo var_dump($output1); and it's giving me a correct $output1[0], so the problem is neither the value coming from $output1.
Any clues?
Edit1: the value of $output1[0] is a string with white spaces ("Green Day").
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 $output1 it shows me the correct string with the white space included.