Home > Backend Development > PHP Tutorial > How to get the code of one php file from another php file in php? (rather than the execution result)

How to get the code of one php file from another php file in php? (rather than the execution result)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-09-15 11:30:55
Original
1276 people have browsed it

I hope the experts can give me some advice.

Reply content:

I hope the experts can give me some advice.

Just read the file.
For example, use file_get_contents

file read doesn’t work

file_get_contents
Curious why you do this?

In this case, I think you can use file_get_content to get the content in the file, and determine whether there is a .php item in the obtained content. If it exists, it proves that it is another file. Put together the path and open the file. Specifically, I haven’t tried it, it’s just an idea!

It’s just a file reading problem. Does it have anything to do with whether it is a php code file? The same goes for reading txt files

include require is to get the execution result
fopen is just to get the file content

Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template