I wrote a sorting algorithm in python.
It returns a Python Dictionary object.
How do i get the dictionary from Python into my PHP code as an associative arr ?
Will I have to write the whole sorting algorithm again in PHP?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Serializing to JSON would be the simplest thing to do:
python:
then in php:
But re sorting – dictionaries in python are not ordered.
if you want to save it ordered and load ordered, save a python list and load a php array.