Adding new data at beginning.
| From: | Jan Grafström | Date: | Thu, 22 Feb 2001 22:04:11 +0000 |
| Subject: | Adding new data at beginning. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-41222@lists.php.net to get a copy of this message | ||
Hi!
I am trying to put in a new data at the beginning of a file.
I have started like this;
--------
$yourfile = "test.xml"; (<a><b><c><d><e><f></c>
this is the file.)
$fp = fopen ($yourfile, r);
$message = array(1 => '<a>', '<b>', '<c>',
'<d>', '<e>', '<f>',
'</c>');
Here I need some code to get the output look like
this"<a><b><new><c><d><e><f></c>"
print_r($message);
fwrite ($fp, $message);
fclose ($fp);
I am thankful for any help.
Regards
Jan