user863771
user863771

Reputation:

Is there a way to see my entire php file along with all the files it includes in one page of source code?

I'm just starting to work with MVC's and something I thought of that would be really helpful for me is if its somehow possible to see my entire php script for a page as one big source file ( as php, not compiled )

I'm talking not only seeing the script as you see it in your editor, but all the includes actually all pieced together as the server will see it right before compile?

I want to do this from my localhost server, I have access to all my php files I want to see.

Is it possible?

Upvotes: 0

Views: 69

Answers (1)

Timur
Timur

Reputation: 6718

If you just want to see source code of included files, use get_included_files():

$files = get_included_files();
foreach( $files as $file ){
    readfile($files);
}

But you can see all the source codes using your IDE/editor as well.

Upvotes: 1

Related Questions