I am trying to export some data from a php script to load into arborjs, problem is the php json_encode encapsulates the node and edge objects in square brackets []
, which upsets arborjs.
json_encode gives:
{"nodes":[{"10":{"auth":"EP","depth":0}}]}
but arborjs wants
{"nodes":{"10":{"auth":"EP","depth":0}}}
Anyone else encountered and solved it?
Issue was with
array_push
does not preserve keys, instead using:
works, preserving keys.