Also you can try this:
<?php
$file = "test.json";
$str = file_get_contents($file);
while(strpos($str,'//')){ //---- while in text exist // do ----
$a = strpos($str,'//'); //---- first position // ----
$b = strpos($str,'"',$a); //--- first position of " in text ---
if($b==0) {$b = strpos($str,'}',$a);} //--- if // at end of file ---
$s1 = substr($str,0,$a); //---- new string from start to // position ---
$s2 = substr($str,$b); //--- string from first " to end of file ---
$str = $s1.$s2; //---- new string without // ----
}
file_put_contents($file,$str);
?>