title: Change variable value saved to file.php
body: <p>I got a file called variables.php</p>
  
  <pre><code>&lt;?php
     $dbhost = 'localhost';
     $dbuser = 'root';
     $dbpass = 'password';
     $dbname = 'database_name';
  ?&gt;
  </code></pre>
  
  <p>I know i can access these variables using <code>include</code> and then using them as i use any other variable but i wish to know, how can i change these variables values. And i don't mean <code>$dbhost = "other_value";</code>. I mean how can i save the new value to that file. I was reading about php and file opening/writing/closing, but i cant find a way, how to place myself and replace the value i want. </p>
  
  <p>The only info i have, is the name of the variable, and the value saved to it right now. I am not sure in what line i can find that variable - if that changes anything. So the question is, how to change (using php) variable <code>dbhost</code> to anything else, that user will put in form. (form part isn't a problem, lets say user value was saved to <code>$_POST['uservalue']</code>)</p>
  
  <p>Thanks in advance.</p>