Please give me some advice, how to add content in the tag of an HTML file using PHP?
人生若只是初见
人生若只是初见 2019-12-04 20:53:37
0
1
973

// 追加内容
$file = fopen(dirname(dirname(__FILE__)).'/index.htm', 'r');
$content = fread($file, filesize(dirname(dirname(__FILE__)).'/index.htm'));
$hello = '' . PHP_EOL . $content;
fclose($file);
$file = fopen(dirname(dirname(__FILE__)).'/index.htm', 'w');
echo fwrite($file, $hello);
fclose($

人生若只是初见
人生若只是初见

reply all (1)
殘留の回憶

Change the html file suffix to .php and add the original php code directly to the required location on the page

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!