Can you make a system call? You can use python script to convert brine data to json:
# pickle2json.py import sys, optparse, cPickle, os try: import json except: import simplejson as json
Thus, if you get data from a file, you can do something like this:
<?php exec("python pickle2json.py -p pickled_data.txt", $json_data = array()); ?>
or if you want to save it in a file:
<?php system("python pickle2json.py -p pickled_data.txt -j p_to_j.json"); ?>
All of the above code is probably not perfect (I'm not a PHP developer), but is something like this working for you?
Eric Palakovich Carr
source share