$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表示你要提换内容的本文
}
PHP 读取目录
Leave a comment
Thanks for good article. Hope to see more soon. . . . .