美文网首页
PHP - php文件内调用html文件

PHP - php文件内调用html文件

作者: GA_ | 来源:发表于2019-07-02 12:12 被阅读0次
<?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>";
?>

相关文章

网友评论

      本文标题:PHP - php文件内调用html文件

      本文链接:https://www.haomeiwen.com/subject/owxizxtx.html