doubu4406 2015-06-16 16:21
浏览 27
已采纳

PHP从文件中保存和检索选项

I use a custom CMS in PHP and I need to let admin user to save a global configuration option for his website.

I would like to store this value into a file. Avoiding to save it into mysql DB, so I don't need to do an extra query on every page load.

What is the best way to store this option from a form into a file? I need to reload my saved setting so it can be edited with my form

  • 写回答

2条回答 默认 最新

  • doutu6658 2015-06-16 16:28
    关注

    Ini file format simple enough for anyone to understand (read). You might want to paste the file's content into a textarea for simple edition.

    For advanced edition, you can use parse_ini_file http://php.net/manual/en/function.parse-ini-file.php .

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求TYPCE母转母转接头24PIN线路板图
  • ¥100 国外网络搭建,有偿交流
  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型