Home > Backend Development > PHP Tutorial > 怎么让文件流的变量运行

怎么让文件流的变量运行

WBOY
Release: 2016-06-13 12:40:48
Original
840 people have browsed it

如何让文件流的变量运行?
1.文本文件a.txt,里面写的是$a
2.我有一个my.php,里面是这样的写的

<br />
<?php<br />
$a="ok";<br />
file_get_content("a.txt","r+");<br />
<br />
//这是操作代码,我不会<br />
//文件读进来了,我马上要再保存成文本,但是我想把文本里面的$a换成php里面$a的值ok<br />
<br />
file_put_content("b.txt","w+");<br />
<br />
Copy after login


文本读入php,里面的东西好像不会和php起反应,打开是$a,在php里面跑了一圈保存了还是$a,有没有办法让文件流里面的变量在php里面运行呢?

即含有$a的a.txt -----> 读入php-------->含有ok的a.txt

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template