I've been doing some research around and haven't found a way to solve the situation I'm faced with now.
I need to pass a Python list to PHP. I've been reading about doing it with JSON but I was wondering if it was possible without it.
My list looks something like this:
a_list = [0,['A1', 'A2', ['A3','A4']], ['B5', 'B2', ['B3','B4']]]
I have found how to pass simple values between Python and PHP but this is a bit more complicated.
Also, I have found on another question asked here something that works for dictionaries:
Python side:
import json
D = {'foo':1, 'baz': 2}
print json.dumps(D)
PHP side:
<?php
$result = json_decode(exec('python myscript.py'), true);
echo $result['foo'];
Any help would be appreciated.
Thanks!