Quote:
Originally Posted by shabbir View Post
Probably r+
Ok. I used r+ and added some more logic to it.
Code:
<?php

$ourFileName="newfile.txt";

if(is_file($ourFileName))
	$fh = fopen($ourFileName, 'r+') or die("Can't open file");
else
	$fh = fopen($ourFileName, 'w') or die("Can't open file");

fwrite($fh,"<image></image>");
fseek($fh,-8,SEEK_END);
fwrite($fh,"Data Written");
fclose($fh);

?>
But still I am not getting expected result.
now the result is as follows:
Code:
<image>Data Written
[/code]