I reviewed a lot of post to delete an item from JSON with PHP but somehow the 'unset' function is not working anywhere in my code. How can I delete 'SPEC_Info' from my JSON file with the code below I created to merge different JSON files (URLs)?
$sets = array();
foreach ($urls as $url)
{
$json = file_get_contents($url);
$data = json_decode($json);
$json = substr($json, 1, -1);
$sets = array_merge($sets, $data);
}
$new = json_encode($sets, JSON_PRETTY_PRINT);
echo '<pre>';
echo $new;
$fp = fopen('dsales_watchjewel_combined_en.json', 'w');
fwrite($fp, $new);
fclose($fp);