Here's what I came up with..............
coupon.html
<html>
<head>
<title>coupon</title>
</head>
<body>
<h1>Not what you are looking for</h1>
<p>5555</p>
<h1>5555</h1>
</body>
</html>
now the php script to make the edits....
<?php
$coupon_file = "coupon.html";
$search_string = "5555";
$replacement = "6666";
$contents = @file_get_contents( $coupon_file );
if(strpos($contents,$search_string) !== false){
$contents = str_replace($search_string,$replacement,$contents);
}
$fp = @fopen( $coupon_file, 'w' );
fwrite( $fp, $contents );
fclose( $fp );
?>
and here was the output for the coupon.html file
<html>
<head>
<title>coupon</title>
</head>
<body>
<h1>Not what you are looking for</h1>
<p>6666</p>
<h1>6666</h1>
</body>
</html>