Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
August 31, 2004, 11:01 pm
rate this thread
translation. It kinda looks like this:
$hello = "hello";
$button_value = "submit";
I need a function that write text such as "$new_translation =
"translation";" on the english.php file on the line before the "?>"
tag, how can I do this?
thanx in advance
- Jasper Bryant-Greene
September 1, 2004, 11:56 pm
Re: how to write in a text file before a given word
The way I understand it, you want a PHP script to modify your PHP
script. If this is not the case, please let me know.
You could do that like this:
$file = file_get_contents('/path/to/english.php');
$file = str_replace('?>',"$new_translation=\"translation\";\n?>",$file);
$fp = fopen('/path/to/english.php','w');
- » PHP/MySQL: using MIN() on an empty set of rows -> query error
- — Previous thread in » PHP Scripting Forum