|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-11-01 16:05 UTC] admin at serveurperso dot com
To every writings the function "fput" adds jumps of lines in too much.
Sample script :
------------------------------------------------
<FORM ACTION = "?save=1" METHOD = "post">
<TEXTAREA NAME = "contenu" ROWS="10" COLS="40">
<?
$fichier = "fichier.txt";
if($save) {
$fp = fopen($fichier, "w");
fputs($fp, stripslashes($contenu));
fclose($fp);
}
readfile($fichier);
?>
</TEXTAREA><BR>
<INPUT TYPE = "submit" VALUE = "Enregistrer">
</FORM>
------------------------------------------------
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
PHP 4.3.0 (build Dec 27 2002) Apache 1.3.23 Win ME This: $f=fopen("bug","w"); fwrite($f,"test "); // 74 65 73 74 _0D 0A_ fclose($f); creates file: 74 65 73 74 _0D 0D 0A_ I'm using plain files with ms-dos line breaks to store databases, so fwrite is _very_ important for me to work correctly.