json_encode($arr, JSON_HEX_QUOT);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => get_site_url().'/api?request=product&type=url&url='.$link,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$productResponse = curl_exec($curl);
$productResponse = trim(json_encode($productResponse), '"');
curl_close($curl);
$productArray = json_decode($productResponse, true);
$productArray = json_decode($productResponse);
update_field('test_1', $productArray['product']['asin'] ,'preloaded_products');
update_field('test_12, $productArray ,'preloaded_products');
//$productResponse это JSON
$productArray = json_decode($productResponse);
update_field('test_1', $productArray['product']['asin'] ,'preloaded_products'); // => пустота
update_field('test_12, $productArray ,'preloaded_products'); // => пустота