0
在此示例中,style.css文件的內容未寫入輸出字符串。我究竟做錯了什麼?打開文件並將其內容複製到另一個文件中
$openFile = get_theme_root() . "/" . get_template() . "/myfile.css";
$customcss = fopen($openFile, 'w');
$customcss.=file_get_contents(get_bloginfo('template_directory')."/styles/test/style.css");
fwrite($openFile, $customcss);
fclose($openFile);
爲什麼不使用file_put_contents而不是fopen,fwrite,fclose? – 2012-03-10 16:13:16
爲什麼不只是['copy'](http://php.net/copy)這個文件? – salathe 2012-03-10 16:45:34