約2000ファイルのテキストのブロックを置き換え、include('myText.php');に置き換える必要があります。
ここでの問題は、それがhtmlファイルにあるということです。その場合、私もphpタグを入れる必要がありますが、それを行う方法が見つかりません。
これが私のコードです
$start = "<is_comment>";
$end = "</is_comment>";
$startChain = strpos($fileContent, $start);
$endChain = strpos($fileContent, $end) + strlen($end);
$text = substr($fileContent, $startChain, $endChain - $startChain);
//echo htmlspecialchars($text);
$content = str_replace($text, "<?php include('showISComment.php?project=$project'); ?>", file_get_contents($file));
そして、それを実行しているphpファイルで、phpタグを配置すると、テキストとしてではなく、自動的にタグとして識別されます。
ありがとう