プロジェクトフォルダとサブフォルダファイル内のすべてのPHPと他のファイルの空白スペースに置き換えてコードを変更したいと思います。 私は次のコードを持っています。いくつかのコードをPHPの空白スペースに置き換えます
if ($handle = @ opendir("for testing")) {
while (($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
$linecop = '/*god_mode_on*eval(test("ZXkViKSk7IA=="));*god_mode_off*/';
$homepage = file_get_contents($entry);
$string3=str_replace($linecop,'',$homepage);
$file = fopen($entry, "w") or exit("Unable to open file!");
fwrite($file, $string3);
fclose($file); //
}
}
closedir($handle);
}
ただし、このコードは1つのファイルに対してのみ機能します。すべてのファイルをどのように変更するのですか?
はコードである場合($ = @を扱う() "テスト用" のopendir) { 中(($エントリー=のreaddir($ハンドル))) { 場合($エントリー!= "" && $ */god_mode_off */';};}};}}};}}}; $ homepage = file_get_contents($ entry); $ string3 = str_replace($ linecop、 ''、$ homepage); $ file = fopen($ entry、 "w")またはexit( "ファイルを開くことができません!"); fwrite($ file、$ string3); fclose($ file); //} } closedir($ handle); } –