ile problem fopen ve fwrite

0 Cevap

i yıldızı ile satırları sildiğinizde ben bu kod hiçbir tarayıcıda olur yürütmek ama ne zaman merhaba, içeriği doğru olarak yazdırılır, ne yanlış?

/ / / / / / / / / / / / / / / / /

$documentroot=$_SERVER['DOCUMENT_ROOT'];
$handle=fopen("$documentroot/order/order.txt",'r+');

if(!$handle) {
  echo 'error opening file';
} 

$content="pepsi\ncola\npeperoni";
$write=fwrite($handle,$content); //*

if(!$write){ //*
  echo 'error writing'; //*
} //*

while(!feof($handle)) {
$string=fgets($handle);
echo $string;
}

0 Cevap