/dev/null'); $c = file_get_contents($f); if ($c === false) { echo json_encode(['error'=>'cannot read']); exit; } $c = str_replace('.sp{display:inline-block;width:10px;height:10px;border:2px solid var(--brd);border-top-color:var(--gold);border-radius:50%;animation:spi .5s linear infinite}', '.spnr{display:inline-block;width:10px;height:10px;border:2px solid var(--brd);border-top-color:var(--gold);border-radius:50%;animation:spi .5s linear infinite}', $c); $c = str_replace('class="sp">', 'class="spnr">', $c); $c = str_replace('', '', $c); file_put_contents($f, $c); echo json_encode(['ok'=>true, 'size'=>strlen($c), 'spnr'=>substr_count($c,'spnr'), 'kh_sp'=>substr_count($c,'.kh.sp')]);