文件hello.php和index.php在同一目录

 

hello.php

<?php

class  hello{

    public function __construct()
    {
        echo 'hello world';
    }

}

index.php

$file = file('hello.php');
print_r($file);

输出结果为:

Array
(
    [0] => <?php

    [1] => 

    [2] => class  hello{

    [3] => 

    [4] =>     public function __construct()

    [5] =>     {

    [6] =>         echo 'hello world';

    [7] =>     }

    [8] => 

    [9] => }

)

 

相关文章:

  • 2021-09-29
  • 2022-12-23
  • 2021-12-08
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2021-10-11
猜你喜欢
  • 2021-11-27
  • 2021-08-09
  • 2021-05-04
  • 2021-06-26
  • 2021-11-27
  • 2022-12-23
  • 2022-02-07
相关资源
相似解决方案