PHP - php文件内调用html文件

2019-07-02  本文已影响0人  GA_
<?php

    // php 文件引用html文件
    // 001
    require('index.html');

    echo "<br>";
    // 002
    $file = fopen('index.html','r');
    if ($file) {
        while(!feof($file)) {
            $line = fgetc($file);
            echo $line;
        }
    };

    fclose($file);

    echo "<br>";
    // 003
    $str = file_get_contents('index.html');
    echo $str;

    echo "<br>";
    // 004
    include ("index.html");

    echo "<br>";
?>
上一篇 下一篇

猜你喜欢

热点阅读