Differences and efficiency between include () and fopen () functions: include () & nbsp; and & nbsp; fopen () & nbsp; Functions & nbsp; difference and efficiency if I want to reference a file, is it highly efficient to use include () or use & nbsp; fopen () & nbsp; high efficiency, what is the difference, such as test. php & nbsp; file & lt ;? Differences and efficiency between php include () and fopen () functions
Q: differences and efficiency between include () and fopen () functions
If I want to reference a file, is it highly efficient to use include () or fopen ()? what is the difference, for example:
Test. php file
$ AB = "sfsadfsadfd ....";
....
?>
High-end files, AB. php
Include (test. php); or fopen (test. php) // Can you call the $ AB variable!
?>
Currently, the mainstream CMS uses INCLUDE or FOPEN to call files!
There is another problem, I use include () to introduce the file, the volume of the variable has Chinese he will be garbled, but I in the header to set the UTF-8, this problem occurs during PHP5.2 testing, but not in the latest PHP version.
Include () garbled fopen ()? Function
Share: More
------ Solution --------------------
Use include ();
You can save it as a social media code.
------ Solution --------------------
Does fopen have the same effect as include? I have to go to manual...
------ Solution --------------------
Include is an external program file that is integrated with the current program.
Fopen is used to open a file.
Each has its own role and cannot be confused.
------ Solution --------------------
The two are different.
------ Solution --------------------
Good introduction, high efficiency
------ Solution --------------------
The include () and fopen () functions differently. include () introduces an external file, which can be an absolute or relative path. if a file is introduced by mistake, a prompt is displayed, and it contains the variable range that inherits the include row, but fopen () is to open a file, which can be an absolute or relative path, or a url request.
------ Solution --------------------
Include is a file, fopen is a file, not the same function
------ Solution --------------------
Include is an external program file that is integrated with the current program.
Fopen is to open a file ??
------ Solution --------------------
Variables cannot be directly used for fopen, and variables can be directly used for include.
------ Solution --------------------
Use a variable after opening. you can add an eval.
I don't know if the function definition is valid.
The two cannot be confused.