if (!is_dir (' txt '))//Determine if TXT is a folder directory
{
mkdir (' txt ');//Create a folder directory named txt
$open =fopen (' txt/in.txt ', ' w+ ');//Open file in read-write mode
if (is_writable (' txt/in.txt '))//If this file is writable mode
{
if (fwrite ($open), "Today is a beautiful day, be happy Oh!" "--") >0)//write content
Fclose ($open);//Close file
echo "";//Output Success Prompt
}
}
Else
{
if (Is_file (' txt/in.txt '))//Determine if the directory exists in.txt file
{
if (is_readable (' txt/in.txt '))//Determine if the file is readable
{
echo file_get_contents (' txt/in.txt ');//Output text information
Unlink (' txt/in.txt ');//delete file In.txt
RmDir (' txt ');//delete directory
}
}
}
?>
Excerpted from Ms. Yuan
http://www.bkjia.com/PHPjc/478239.html www.bkjia.com true http://www.bkjia.com/PHPjc/478239.html techarticle php if (!is_dir (TXT))//Determine whether TXT is a folder directory {mkdir (TXT);//Create a folder directory named txt $open =fopen (txt/in.txt,w+);//Open file as read/write if (is _writable ...