Re: Stripping a JSON of extra characters in PHP

Arno Welzel <[email protected]> Sun, 5 Feb 2023 00:30:16 +0100
Newsgroups comp.lang.php
Message-ID <[email protected]>
J.O. Aho, 2023-02-04 11:23:

> On 01/02/2023 17:09, Ben Bacarisse wrote:
>> [email protected] (The Doctor) writes:
>>
>>>  From https://developer.moneris.com/livedemo/checkout/preload_req/guide/dotnet
>>>
>>> I need a JSON as follows:
>>>
>>> {
>>> 	"store_id":"moneris",
>>> 	"api_token":"hurgle",
>>
>> What you pasted as what you "need" is not even valid JSON and has a huge
>> number of pointless spaces in it making it almost unreadable (in my news
>> client). 
>> I don't know what it is you mean.
> As I saw it, the OP post was more about the formatting of the json that 
> is generated than about if his json was correct or not, he wants a multi 
> line json with indentations instead of a single line compressed json.

The OP showed to examples of *similar* JSON data with many identical
properties, but in a slightly different structure. So I am not sure if
the question was onloy about formatting - but only the OP can tell.

-- 
Arno Welzel
https://arnowelzel.de