Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
file_get_contents()不是这样做的正确方法......
file_get_contents()
我想加载一个 PHP 脚本以便它运行,并将输出写入 CSS 文件。
这是怎么做的?
使用PHP 缓冲
ob_start(); // Prepare and assign your code in $data variable echo $data; $content = ob_get_clean(); file_put_contents($file_path, $content);