View Full Version : read/write file with multy line strings

02-18-2003, 12:02 PM
I'm trying write a script to translate language files online.
my language files conteins text variables that I need to translate.
$string['left'] = "Left";

some of them are multi line:
$string['error'] = "You are not logged in.
Please login here or register.";

and some of them have arrays:
$sort['images'] = array(
"ASC" => "Ascending",
"DESC" => "Descending"

So, to read the files, I just do include("lang.php"); and then pull value of each variable, it was easy, but now I'm having problem (just dont have an idea how to) with write new values for each variable into the file...
can someone give me an idea what is the best way to do so and/or how to?


Dylan Leblanc
02-18-2003, 12:48 PM
var_export() will dump the contents of a variable as valid PHP code