LinksTraffic

Php - Ecriture dans un fichier

english directory french directory
Recherche: Recherche avancée

Accueil Webmaster | Tutoriaux | Web Scripts

Super Tirage - Ouah

Php - Ecriture dans un fichier

Php par catégorie
php code snippets Accueil Php data SEO image 3d Graphisme networking Réseau
user management Les utilisateurs file i/o Fichier I/Ofile i/o XML

Ecrire dans un fichier

Faites un copier coller du code ci-dessous et lancez le dans votre navigateur.
Si vous souhaitez voir le résultat en démo (selon nous une bonne méthode d'apprentissage) cliquez ici (nouvelle fenêtre).

The writefile.html file (online form):

The writefile.php file:

From the page http://www.php.net...fopen.php you can learn about the following features:

A list of possible modes for fopen() using mode:

modeDescription
'r'Open for reading only; place the file pointer at the beginning of the file.
'r+'Open for reading and writing; place the file pointer at the beginning of the file.
'w'Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.
'w+'Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.
'a'Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it.
'a+'Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it.
'x'Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is supported in PHP 4.3.2 and later, and only works for local files.
'x+'Create and open for reading and writing; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is supported in PHP 4.3.2 and later, and only works for local files.

Commentaires

Pas de commentaire, écrivez en un ou venez en discuter sur notre forum des pros du web.

Coin du Webmaster

Vous disposez d'un site à forte audience?

Obtenez votre Kit Graphique pour vos sites!

Engagez des Freelance Pro.

1and1 Internet

Catégories

Copyright 2004-2008 @ LinksTraffic RHM Solution ::: Partenaires | Mention | Contactez nous