I'm trying to replace a string in a file, so far so good. The file is a htm file in html format bt this shouldn't be a problem.
My script looks like this:
$file = './test.htm';
$content = file_get_contents($file);
$str = str_replace('Signature','Test',$content);
file_put_contents('./test2.htm', $str);
The problem is str_replace doesn't replace the string "Signature", the output file has exactly the same content as my input file.
If I use the file content without file_get_contetnts, just while defining the string as a variable, my script works like a charme.