I'm trying to send an array (with a length of 45,000) from PHP to Python and back.
From PHP to Python:
$a = shell_exec('/usr/bin/python2.7 script.py "'.$b.'" '.escapeshellarg(json_encode($array)));
From Python to PHP:
B = json.loads(sys.argv[1])
print json.dumps(B)
And in the PHP code:
$output = json_decode($a);
$arrfinal = array_values($output);
Hope this is make sense..
So i try to run it for 3700 rows of the array and it works just fine.
if i try to run it for more than 3700 rows it gives me a syntex error (from json_last_error()
)
So my question is, Is there anyway I can check if string will make a json syntex error if will be "changed" to json format before it "change"?
Thanks!
P.S already try changing everything to UTF-8 after hours of searching online..
Sorry for my English..