no. it won't work if the string i am try to replace is between two hyperlinks, or between a hyperlink and the beginning of the file, so after the last hyperlink in a file, it will replace strings, but not before.
$toedit is set beforehand with a for loop
include("config.txt");
include($updatepath); #set in config.txt
$open = fopen($updatepath, "r");
$saved = fread($open, filesize($updatepath));
fclose($open);
$newpost = str_replace($post[$toedit], $newmessage, $saved);
$newpost = str_replace($nizame[$toedit], $newname, $newpost);
$open = fopen($updatepath, "w");
fwrite($open, $newpost);
fclose($open);
that's basically it.