php中json_encode(array)的输出

时间:2013-07-04 04:05:11

标签: php python json numpy

PHP:

echo json_encode($temp);
$rtu = shell_exec("C:/Python27/python 123.py ".json_encode($temp));

的Python:

import sys, json
import numpy as np
from numpy import matrix
from numpy import array
A=np.matrix(json.loads(sys.argv[1]))
print A
print ("<br/>")
M=A.I
B = np.asarray(M)
print (json.dumps(B.tolist()))

我有这个数组$temp(29x29)但是当我回显它的json_encode时,我的前28行被正确打印(如{"0":0,"1":0,"2":0...中所示),但第29行打印为[0,0,0..]。此外,输出$rtu将变为空。任何人都可以解决这个问题吗?

0 个答案:

没有答案