PHP文件处理(f open,f read,f white)
Bat_Moban.txt
1 2 3 4 5 6 7 | :pi
ping -n 1 | find "TTL=" > nul
if errorlevel 1 (
goto pi
) else (
start 360chrome . exe --disable-infobars --autoplay-policy=no-user-gesture-required --disable-background-networking --kiosk
)
|
生成BAT文件
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php
$bat_txt = fopen ( "soft/bat/Bat_Moban.txt" , 'r' );
$data_txt = fread ( $bat_txt , 2048);
$data_txt = str_replace ( "{#IP#}" , "mdaima.com" , $data_txt );
$data_txt = str_replace ( "{#URL#}" , "mdaima.com" , $data_txt );
$down_url = "soft/bat/bat_new.bat" ;
$bat_new = fopen ( $down_url , "w" );
fwrite( $bat_new , $data_txt );
fclose( $bat_new );
?>
|
以上fopen,fwhite这些因服务器运营商安全管理问题,不能连写,使用时需取消中间空格。