Код: Выделить всё
// create variable for the search
$find="";
//create the replacement string from the text file
$handle = fopen($head.txt, "r");
$insert = fread($handle, filesize("head.txt"));
fclose($handle);
// read the html file to be searched into a variable
// $target_file includes the directory uploaded earlier in the php so now resides in the 'article' folder, "w" as it will be overwritten.
$file = fopen($target_file, "w");
$workingile=fread($file,filesize($target_file));
// now do the search and replace, the altered file becoming $newfile
$newfile=str_replace($find, $insert, $workingfile);
// write the new html back into the old one
fwrite($file, $newfile);
//tidy up
fclose($file);
< /code>
Это то, что я хочу добавить, чтобы заменить < /p>
Подробнее здесь: https://stackoverflow.com/questions/796 ... head-and-a
Мобильная версия