title: Write Database values to a .ini file as per the INI parameter using PHP Codeigniter
body: <p>I am fetching some records from database, result of my query returns some values like:</p>
  
  <p><strong>Domain:</strong></p>
  
  <p><strong>Proxy:</strong></p>
  
  <p><strong>Port</strong></p>
  
  <p><strong>Server_Mode:</strong></p>
  
  <p>Now I have a ini file which has these parameters whose value will be empty, So when user edits a file for first time I fetch these records from database and i want to put this according to file parameters.</p>
  
  <p>What I mean is the .ini file will be something like this:</p>
  
  <pre><code>[INIDetails]
  SipUserName = 
  Password = 
  Domain = 
  Proxy = 
  Port = 
  SipAuthName = 
  DisplayName = 
  ServerMode = 
  </code></pre>
  
  <p>Now I want to put the values from database against each parameter. How do I do this?</p>
  
  <p>In my view I Do :</p>
  
  <pre><code>if(empty($file_data))
          {   
  
              echo form_input($value_param, set_value('$value_param',$pbx_data));
          }
          else
          {
              echo form_input($value_param, set_value($value_param, $parameters[$type][$value_param]),'readonly');
          }
  </code></pre>
  
  <p>Now the result of array from my query is:= <strong>$pbx_params</strong>
  And in that array i have <code>domain,proxy,port,server_mode</code>. HOw to write thier values to file  ?
   I guess I have to loop through the values from database and check it with .ini parameter if they match then put the value from db of that row</p>