Jason Carson wrote:
> Hello everybody,
>
> How would I go about writing stuff to a file but in between the
> tags?
>
> Example, say I have config.php as follows...
>
>
> $hostname = "localhost";
> $database = "database";
> $username = "username";
> $password = "password";
>
> ?>
>
> How would I go about adding stuff at the end of the file, but before the
> ?> tag?
>
The way I've done this in the past is to use an array. Then I can
include the file, change the array and then var_export() to the file:
//config.php
'localhost',
'database' => 'database',
'username' => 'username',
'password' => 'password',
);
//file that does the changing writing
";
file_put_contents('config.php', $content);
--
Thanks!
-Shawn
http://www.spidean.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php