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