Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 209081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:53:00+00:00 2026-05-11T17:53:00+00:00

I am writing a PHP application that will have the ability to edit settings

  • 0

I am writing a PHP application that will have the ability to edit settings through a web interface. I didn’t mean for the user (and actually, it will only be admins) to be able to load the file up in a text editor, but rather, they make a change using a form, and that will change the settings file (and do other things as well).

At this stage in the development, settings are stored in a PHP file, for example:

define ('UPLOAD_DIR','uploads/');
define ('DISPLAY_NUM',true);
$names = array('a' => 'b','c'=>'d','e'=>'f');

However, parsing arrays (and they get more complicated (i.e multilevel nested) than the above), doesn’t seem so fun. And because specific settings can be added and removed, reading the entire file, and then writing out all the settings again, doesn’t seem fun either.

What are the advantages and disadvantages to using the following formats? (And any others that I missed out):

  • Custom XML
  • INI (able to use parse_ini_file)

(Using a database is not suitable due to the requirements for the project. I understand in many situations a database would be prefered, just not in this case.)

If you were unable to use a database, and had to store settings that could be edited using a web interface, what would you do?

(Note: This is a different question to this one, where settings can’t be changed, it’s PHP file all the way. And yes, the setup does currently write out a PHP file with the correct settings.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:53:00+00:00Added an answer on May 11, 2026 at 5:53 pm

    OK, I didn’t get any sort of answer I was looking for. Here’s the sort of thing I was expecting.

    INI

    • Storing settings in an INI file might be appropriate for simple settings which you want the user to edit by hand.
    • However, creating complex arrays is not easy, and would require some mental acrobatics to understand which heading is at which level of the array.
    • Reserved words, which must not be used anywhere in the file, include: yes, no, true, and false, this might be problematic.
    • Constants can be used in the file.
    • No built in method of writing out INI files.

    XML

    • Can use the SimpleXML Extension, which “provides a very simple and easily usable toolset” to turn XML into an object that can then be processed using the normal methods.
    • Allows the use of very complex arrays.
    • Possible to edit by hand, if required.
    • Can use external tools to verify the validity of the file.
    • Many many XML processors available for PHP.

    YAML

    • http://yaml.org/
    • http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse%5Fini%5Ffile

    Remember: no database. Requires being able to use complex arrays.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 188k
  • Answers 189k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It looks like you are passing in an iterator as… May 12, 2026 at 5:41 pm
  • Editorial Team
    Editorial Team added an answer you should use parse_url May 12, 2026 at 5:41 pm
  • Editorial Team
    Editorial Team added an answer Microsoft Geneva Framework May 12, 2026 at 5:41 pm

Related Questions

I am writing a web application using PHP. I want to use the MVC
I'm writing a simple web application using CakePHP version 1.2 (the latest) and am
I am used to writing C# Windows applications. However, I have some free hosted
I know I'll get a thousand Depends on what you're trying to do answers,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.