码迷,mamicode.com
首页 > Web开发 > 详细

php之获取程序源码的方法

时间:2015-05-11 12:54:22      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:

文件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] => }

)

 

php之获取程序源码的方法

标签:

原文地址:http://www.cnblogs.com/shaoyikai/p/4494121.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!