How to run variable of file stream

Source: Internet
Author: User
How to run the variable of the file stream? 1.20.file a.txt, which is written in $ a2. I have a my. php file, which is written like this & lt ;? Php $ a = "OK"; file_get_content ("a.txt", "r +"); // This is the operation code. I will not // read the file, how can I run the variable of the file stream immediately?
1.20.file a.txt, which is written in $
2. I have my. php, which is written in this way.

$ A = "OK ";
File_get_content ("a.txt", "r + ");

// This is the operation code. I won't
// When the file is read, I will save it as text soon, but I want to replace $ a in the text with the value of $ a in php. OK

File_put_content ("B .txt", "w + ");



When the text is read into php, the content in it does not seem to respond to php. open $ a and run a circle in php to save it or $, is there a way to run the variables in the file stream in php?

That is, a.txt ----- with runtime a> read to php --------> share a.txt:
------ Solution --------------------
Text Replacement
Ob + eval
Ob + include
Ob + phar

------ Solution --------------------
Let's take a look at the string functions.
------ Solution --------------------
I guess you need to use the eval function.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.