Skip to content

Instantly share code, notes, and snippets.

@jmwebservices
Created November 19, 2019 04:28
Show Gist options
  • Save jmwebservices/cdb2329fea2ee7f88e85cc22efc667fa to your computer and use it in GitHub Desktop.
Save jmwebservices/cdb2329fea2ee7f88e85cc22efc667fa to your computer and use it in GitHub Desktop.
PHP fopen Modes Impact on Read, Write and Seek

PHP fopen Modes Impact on Read, Write and Seek

Use the following table as a desk reference for the various fopen modes and how they impact read, write and seek.

Mode Read Write Seek
r ✔️ ✔️
r+ ✔️ ✔️ ✔️
w ✔️ ✔️
w+ ✔️ ✔️ ✔️
a ✔️
a+ ✔️ ✔️ ✔️
x ✔️ ✔️
x+ ✔️ ✔️ ✔️
c ✔️ ✔️
c+ ✔️ ✔️ ✔️
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment