/fileIO/fOpen.php
PHP | 20 lines | 11 code | 0 blank | 9 comment | 1 complexity | f41996ff9b51b1dd635c1c865adbd1e6 MD5 | raw file
- <?php
- /*
- * modes: r, w, a, r+, w+, a+, x+:
- * r: read from start(file must exist),
- * w: truncate/write from start,
- * a: append/write from end,
- * x: write from start (file can't exist)
- * add "+" after each to make read mode
- *
- */
- $file = 'filetext.txt';
- if($handle = fopen($file, 'w'))
- {
- fclose($handle);
- }
- else
- {
- echo "<p>Could not open file or writing</p>";
- }
- ?>