# Php write?

**URL:** https://forum.kirupa.com/t/php-write/155698
**Category:** Uncategorized
**Created:** [July 19, 2005, 6:21pm UTC](https://forum.kirupa.com/t/php-write/155698 "2005-07-19T18:21:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tanel96](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@tanel96](https://forum.kirupa.com/u/tanel96)
#### Post date: [July 19, 2005, 6:21pm UTC](https://forum.kirupa.com/t/php-write/155698/1 "2005-07-19T18:21:43Z")

</div>

i’m using the following code to display the contents on stuff.xml into a textarea:

\<?php  
$handle = fopen(“stuff.xml”, “r+”);  
while (!feof ($handle)) {  
$buffer .= fgets($handle, 4096);  
}  
fclose ($handle);  
?\>

now, how can i save the changes done in the textarea… as far as i have read, i can either write at the top, or at the bottom of the file… but i want to overwrite the file completely… how can i do that ?
