Здравствуйте, я довольно новичок в json и cURL в среде WordPress. Я пытаюсь очистить данные json, которые выводятся из моего ответа cURL. Прямо сейчас все начинается так:
{"resultCode":"SUCCESS",
"resultReason":null,
"resultDetail":null,
"data":{"page_count":50,
"total_count":1948,
"product_list":[{"product_id":"014a20b1-dbe7-11e8-a53e-0236cac9056a",
"product_status":"ACTIVE",
"last_updated_at":"2019-10-07T15:43:54.000-...
Я бы хотел, чтобы оно началось здесь, когда оно будет напечатано после «данных»:
{"page_count":50,
"total_count":1948,
"product_list":[{"product_id":"014a20b1-dbe7-11e8-a53e-0236cac9056a",
"product_status":"ACTIVE",
"last_updated_at":"2019-10-07T15:43:54.000-...
функция php, под которой я ее имею выглядит так:
function cornerstonetreez () {
$ch = curl_init();
curl_setopt($ch,
CURLOPT_URL,"https://api.treez.io/v2.0/dispensary/cornerstone/product/product_list?
category_type=all&page=1&pagesize=50&active=true");
$headers = array();
$headers[] = 'authorization: authorizationkeyhere';
$headers[] = 'client_id: clientkey';
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
$server_output = curl_exec ($ch);
curl_close ($ch);
$json_string = json_encode($server_output, JSON_PRETTY_PRINT);
print $json_string ;
}
add_shortcode( 'helloworld', 'cornerstonetreez' );
любая помощь будет принята с благодарностью. Спасибо!