PHP 读取目录

$url = “/var/www/test/app/webapp/modules/SurveyAquair/templates”;
if ( file_exists($url) ){//检查文件或目录是否存在
$dir = opendir($url);//打开目录句柄
$fullpath = $url.”/edm.html”;
$body = file_get_contents($fullpath);//读取数据
$body = str_replace(“{{id}}”,$Id_1,$body); {{id}}表示要提换的内容,$Id_1表示提换后的内容,$body表示你要提换内容的本文
}

相关内容:

Leave a comment

1 Comments.

  1. Thanks for good article. Hope to see more soon. . . . .

发表评论

您的电子邮箱不会被公开。 标记为 * 的区域必须填写

*


您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

有人回复时邮件通知我