PHP execute the python script, which links to my neo4j database. The query is correctly executed, but i want to export the output of the this script in php. How can I do ?
Thanks for the answer.
Practically my JS code do an ajax call to the PHP script. This calls the python script which execute the query. I want to return the output of the query from python to JS code through the php script like an ajax call
Make sure the JSON is the only thing in the output to your Python code.
shell_exec in PHP will return the output from executed command, which will be JSON. You can directly return this JSON to the client then (if result of a XHR) or convert it into a PHP object with json_decode and manipulate it before returning it.
there is no practical way to do that. Neo4j return output in json type data structure. so whatever you are querying will return a result with nodes and relationship in JSON.
so you need to write a parser in python then this data would carry forward to your PHP script.
Directly you can not send data in PHP.