▼  Site Navigation Main Articles News Search  ▼  Anime + Manga Anime Reviews Anime Characters Gallery Screenshots Manga Reviews  ▼  Misc Links to Webcomics Bible Quotes About Older Musings
site version 7.3
PHP –– create a file
written by: admin


Date Written: 3/13/10 Last Updated: 11/3/19

This simple little script will create a file.  x+ means you can open the file, write to it and edit it.  If the file does not exist it will attempt to create it and if the file does exist an error message will be displayed.  For example in this script the file upload.php is created in the directory that the script is running in.  fopen()
<?php
$handle = fopen("upload.php", "a+");
?>


a+ will open a file for reading and writing.  If the file does not exist it will attempt to create it.

TAGS: php, flatfile
copyright 2005–2024