▼  Site Navigation Main About Search Articles  ▼  Anime + Manga Anime Reviews Anime Characters Gallery Screenshots Manga Reviews  ▼  Misc News Links to Webcomics Bible Quotes Member Control Panel  ▼  Forum etc. Forums Older Musings Wordpress
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–2019