exec() file_get_contents() file_put_contents() 示例
1.
<?php
$abc = "chenshan";
exec("ls", $out);
$tmp_out = json_encode($out);
exec("echo $tmp_out > tmp2.txt");
file_put_contents(dirname(__FILE__) . "/tmp3.txt", $abc . "
", FILE_APPEND)
?>2.
<?php
$input = file_get_contents(dirname(__FILE__) . "/testinput.txt");
$input2 = str_replace("><", ">
<", $input);
file_put_contents(dirname(__FILE__) . "/tmp3.txt", $input2 . "
", FILE_APPEND);
?>声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇: 省略PHP结束标记 “?>”的好处
- 下一篇:没有了
