how to mount the json of this respective call

0

I have a problem I do not know how to mount the json of this call in php to send by curl, could anyone help me?

"auto_recurring": {
        "frequency": 1,
        "frequency_type": "months",
        "transaction_amount": 200
 }
    
asked by anonymous 07.04.2018 / 01:06

1 answer

0

Do this:

$array = [
    "auto_recurring" =>[
        "frequency" => 1,
        "frequency_type" => "months",
        "transaction_amount" => 200
    ]
];

After converting to json, do the following:

json_encode($array);

The output of the above line is:

"auto_recurring": {
        "frequency": 1,
        "frequency_type": "months",
        "transaction_amount": 200
 }
    
27.04.2018 / 16:36