Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: del automatinio isirasimo i txt

Parašė FuturesF1re· 2009 Vas. 11 14:02:47
#1

norejau paklausti koks php kodas yra kad suvedus automatiskai isirasytu i txt?

Parašė Peacemaker· 2009 Vas. 11 14:02:27
#2

<?php
$filename = 'test.txt';
$somecontent = "Add this to the file\n";

// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {

// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}

// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}

echo "Success, wrote ($somecontent) to file ($filename)";

fclose($handle);

} else {
echo "The file $filename is not writable";
}
?>

'test.txt'; keiti į savo.

Redagavo Peacemaker· 2009 Vas. 11 14:02:36

Parašė FuturesF1re· 2009 Vas. 11 16:02:06
#3

o is kur gave sia info?

Parašė Peacemaker· 2009 Vas. 11 16:02:19
#4

Internete tokios medžiagos kiek tik nori.