Re: Stripping a JSON of extra characters in PHP

[email protected] (The Doctor) Tue, 7 Feb 2023 16:05:15 -0000 (UTC)
Newsgroups comp.lang.php
Organization NetKnow News
Message-ID <[email protected]>
In article <[email protected]>,
Arno Welzel  <[email protected]> wrote:
>The Doctor, 2023-02-07 01:57:
>
>> In article <[email protected]>,
>> Arno Welzel  <[email protected]> wrote:
>>> The Doctor, 2023-02-06 16:28:
>>>
>>> [...]
>>>> The cart is being derived from a previous form being passed into PHP!
>>>
>>> [...]
>>>> $arr=array(
>>>> 'store_id' => "store3",
>>>> 'api_token' => "yesguy",
>>>> 'checkout_id' => "chktGLFZQtore3",
>>>> 'txn_total' => $_POST['charge_total'],
>>>> 'environment' => "qa",
>>>> 'action' => "preload",
>>>> 'cart' => array( 
>>>> (foreach ($_POST['quantity'] as $key => $value) {
>>>
>>> Well - this will result in an array in the JSON named "cart".
>>>
>>>> 	$cart['items'][] =array(
>>>
>>> And this will also become an array named "items" inside "cart".
>>>
>>> So if you don't want "cart" to be an array in the JSON, then don't
>>> create it this way.
>>>
>>> Learn how to read JSON and that the "punctuation" are not just
>>> characters but have a specific meaning. In this case you created an
>>> array and the JSON will have an array as well - indicated by "[" and "]".
>>>
>> 
>> Again basing this on Moneris prereqs.
>
>What is "Moneris prereqs"?
>
>Your OP was: "How can I carefully strip unnecessary punctuation?" I
>tried to explain to you, where these "punctuation" comes from. But if
>you don't accept the facts, then you have to live with it.
>
>

https://developer.moneris.com/livedemo/checkout/preload_req/guide/dotnet

>-- 
>Arno Welzel
>https://arnowelzel.de
>


-- 
Member - Liberal International This is [email protected] Ici [email protected]
Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising!
Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b 
Extremism is for those who love judging, and care nothing for accuracy. -unknown Beware https://mindspring.com