Complete PHP Filesystem Reference
The fopen() function opens a file or URL.
If fopen() fails, it returns FALSE and an error on failure. You can hide the error output by adding an '@' in front of the function name.
| Parameter | Description |
|---|---|
| filename | Required. Specifies the file or URL to open |
| mode | Required. Specifies the type of access you require to the
file/stream. Possible values:
|
| include_path | Optional. Set this parameter to '1' if you want to search for the file in the include_path (in php.ini) as well |
| context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
Note: When writing to a text file, be sure to use the correct line-ending character! Unix systems use \n, Windows systems use \r\n, and Macintosh systems use \r as the line ending character. Windows offers a translation flag ('t') which will translate \n to \r\n when working with the file. You can also use 'b' to force binary mode. To use these flags, specify either 'b' or 't' as the last character of the mode parameter.
Complete PHP Filesystem Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|