Obtain the string containing the file execution result to describe the problem. a simple model is provided below:
For example, a file named a. php contains the following content:
Welcome:
Cancel
There is another file B. php
In B. php can read File. php content is not post-execution content. if you want to explain the code in php and get the following result for $ s, is there any good way?
Welcome: James canceled
Reply to discussion (solution)
Directly require/include
Directly require/include
I know this, but I want to get this string ~~~
$ S = file_get_contents ('http: // localhost/a. php ');
Replace "include" with the specific content you want.
B. modify php as follows:
ob_start();include 'a.php';$s = ob_get_clean);
Parentheses are missing.
ob_start();include 'a.php';$s = ob_get_clean();
The problem has been solved in another way. thank you !!!