文本文件格式如下,读取我知道
但不知道怎么更新:文本文件类容格式:tilte="文章标题";
message="文章内容";
web="www";
更新也想用数组
读取用数组:
$ar= array();
$ar= parse_ini_file("file.txt");
echo $ar[web];
echo $ar[tilte];
echo $ar[message]; 

解决方案 »

  1.   

    fopen() fread() fwrite()php手册文件系统函数库代码其实没几行,但是建议楼主自己查查,相关函数以及章节都给出了,楼主加油~~~
      

  2.   

    fopen()   fread()   fwrite() 
      

  3.   

    这个文件原来你是怎么写入的?$test = array('aaa', 'bbb', 'ccc');
    $test = implode("\r\n", $test);
    $fp = fopen('config.php', 'w');
    fwrite($fp ,$test);
    fclose($fp);
      

  4.   

    提醒楼主一下,parse_ini_file()用于解析ini文件,txt,php等文件都不行如果要读取或写入txt,php文件,要fopen,fread,fwrite
      

  5.   

    str_replace()替换,然后再写入。