我正在从头开始编写 php codeigniter,我正在尝试知道文件助手中的 write_file 函数,这是我的控制器
<?php
class Files extends CI_Controller {
var $file;
function Files()
{
$this->file = "application" . DIRECTORY_SEPARATOR . "files" . DIRECTORY_SEPARATOR . "hello.txt";
}
function write_file(){
$data = "Hello World !! :)";
write_file($this->file,$data ,'a');
echo "writing is finishing...";
}
}
我的版本是 2.1.4,befog 我把'a' 很好用,但是在我添加它之后它给了我这个错误
Call to undefined function write_file() in C:\wamp\www\test7\application\controllers\files.php