Permanently write variables to a php file with php

Posted by Oliver on Stack Overflow See other posts from Stack Overflow or by Oliver
Published on 2010-03-24T10:47:34Z Indexed on 2010/03/24 10:53 UTC
Read the original article Hit count: 276

Filed under:
|

I need to be able to permanently change variables in a php file using php.

I am creating a multilanguage site using codeigniter and using the language helper which stores the text in php files in variables in this format: $lang['title'] = "Stuff";

I've been able to access the plain text of the files using fopen() etc and I it seems that I could probably locate the areas I want to edit with with regular expressions and rewrite the file once I've made the changes but it seems a bit hacky.

Is there any easy way to edit these variables permanently using php?

Cheers

© Stack Overflow or respective owner

Related posts about php

Related posts about codeigniter