PHP write file interface

static function writeFile public ($ filePath = '', $ ctt = '')
{
$ dir_name = dirname ($ filePath);
// create the directory does not exist on the
IF (file_exists ($ dir_name)!)
{mkdir ($ dir_name, 0777 , to true);} // 0755
// open channel does not exist, the resource file is automatically created
$ FP = the fopen ($ filePath, "W");
// write the file
fwrite (FP $, $ CTT);
// close the resource channel
fclose ($ FP);
}

Guess you like

Origin www.cnblogs.com/xjiaer/p/11764501.html