<?php function get_inner_string($a,$b,$c) { $y = explode($b,$a); $x = explode($c,$y[1]); return $x[0]; } $file = 'cache/94ddd435242c289003eca450b102df52.html'; $open_file = file_get_contents($file); $find_ad = get_inner_string($open_file, '<!-- Begin: AdBrite, Generated: 2008-12-18 16:23:11 -->', '<!-- End: AdBrite -->'); $new_ad = 'NEW AD'; $new_result = str_replace($new_ad, $find_ad, $open_file); echo $new_result; file_put_contents($open_file, $new_result); ?>
str_replace ($find_ad, $new_ad, $open_file);