牛骨文教育服务平台(让学习变的简单)
博文笔记

exec() file_get_contents() file_put_contents() 示例

创建时间:2012-05-24 投稿人: 浏览次数:475

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);
?>



声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。