|
Posted by shimmyshack on 06/07/07 17:01
On Jun 7, 4:17 pm, Feanor <Collin.Moer...@gmail.com> wrote:
> i have the following php code set up to test:
>
> <html>
> <body>
>
> <?php
> if(!$xml = fopen("regData.xml","r+"))
> {
> echo "ERROR: unable to Open regData.xml";
> exit;
> }
>
> fseek($xml, 0, SEEK_END);
> fwrite($xml, "<test>");
> fclose($xml);
>
> ?>
>
> </body>
> </html>
>
> my original regData.xml:
>
> <reg>
>
> </reg>
>
> regData.xml after php code run:
>
> <test>
>
> Any thoughts on why <test> isnt appended to the end of the file so it
> looks like this?:
>
> <reg>
>
> </reg><test>
tried using a+ flag?
and you could of course (php5) use
file_put_contents( $filename, $data, FILE_APPEND );
[Back to original message]
|