E
E
Evgeny Antipov2017-11-29 17:34:44
PHP
Evgeny Antipov, 2017-11-29 17:34:44

Parsing JSON format ISPManager API?

It's inconvenient to use XML. By default, there is an output in JSON.
The problem is that JSON comes prefixed with $.
In this connection, the further use of these keys on the puff is not possible.
How can you use these variables or how to change the prefix in the settings of the panel itself. I didn't find anything in the documentation.

stdClass Object
(
    [$id] => 51b9a6c4a98d
    [$level] => 16
    [$] => 51b9a6c4a98d
)

Well, except for such copulation ... (stdClass Object)->{"\$id"}... but this is nonsense.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny Antipov, 2017-12-05
@elevennine

Through the support partly solved the problem. It turns out there is an undocumented old_json that outputs usable arrays. However, everything is already done through SimpleXML.
forum.ispsystem.ru/archive/index.php/t-26120.html

S
synapse_people, 2017-11-29
@synapse_people

parse into an array
Or replace in JSON $ with emptiness str_replace

B
Boris Syomov, 2017-11-29
@kotomyava

Maybe just walk through the line with json before using it, and cut / replace with the $ regex in the key names?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question