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 913889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:37:49+00:00 2026-05-15T17:37:49+00:00

parse_ini_file could be used to get configuration values from an ini file to use

  • 0

parse_ini_file could be used to get configuration values from an ini file to use in the code, suppose your app changes some of those values and you want to set new defaults, is there a function to take the associative array and write the ini file over?

  • 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-15T17:37:50+00:00Added an answer on May 15, 2026 at 5:37 pm

    You could use Zend Framework’s Zend_Config_Writer_Ini to write the Ini File back to file. Because Zend Framework is component library, you can use only this component without having to migrate your entire application to ZF.

    If you don’t mind the config not being an Ini but PHP arrays, you can also use this code to load and write back the configs:

    function config_read($filename)
    {
        $config = include $filename;
        return $config;
    }
    function config_write($filename, array $config)
    {
        $config = var_export($config, true);
        file_put_contents($filename, "<?php return $config ;");
    }
    

    Somewhat related question and my answer to it:

    • Reading and Writing Configuration Files
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know some people store settings in an .ini file and get the values
I parse some values from an xml file. There is a @25-12-2010'T'23:40:00 string with
The function below takes the test-backup.ini file, parses it and inputs the values into
I have a .ini file for a configuration of my database and a constructor
At work we use a .ini file to set variables prior to calling the
I have a configuration file like the following, NameA=3 NameB=2 NameC=1 The following code
I am using parse_ini_file to read the contents of a file however it is
Is there any special function to parse a .conf file in php like parse_ini_file()
Basically, I would like a simple, easy, one-file way to parse an INI file
Hey I have this kinda structure in my ini file I want to be

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.