File Handling

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:56 AM on 5/18/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

33 Terms

1
New cards

Config Files

Applications store .ini / .json / .xml settings that PHP reads at runtime.

2
New cards

w+

Opens file for read and write.

3
New cards

x

New file is created for write only.

4
New cards

fread()

A function reads from an open file

5
New cards

readfile()

A function reads a file and writes it to the output buffer.

6
New cards

fwrite()

New file can be created or text can be appended to an existing file using

7
New cards

getcwd

Is a built-in PHP utility used to retrieve the current working directory of a script.

8
New cards

is_dir

Checks if a directory exists

9
New cards

rmdir()

Function in PHP is used to remove an empty directory.

10
New cards

pathinfo()

Get information about a file path

11
New cards

Log Files

Web servers write access and error logs to disk for debugging and monitoring.

12
New cards

CSV/Data Export

Generate downloadable reports from database queries without external tools.

13
New cards

fopen()

A function is used to open a file.

14
New cards

r

File is opened for read only.

15
New cards

fclose()

File is closed using

Its argument is file which needs to be closed,

16
New cards

feof()

Function checks if the "end-of-file" (EOF) has been reached.

17
New cards

copy()

A function is a built-in filesystem utility used to duplicate a file from a source path to a destination path

18
New cards

rename()

Renames a file or director

19
New cards

scandir()

List files and directories inside the selected directory

20
New cards

User Uploads

Profile photos, resumes, documents — stored on the server file system.

21
New cards

Caching

Store rendered HTML or API responses as flat files to reduce DB queries.

22
New cards

CMS Content

Static site generators and CMS systems read Markdown files from directories.

23
New cards

w

Opens a file for write only. If file not exist then new file is created and if file already exists then contents of file is erased

24
New cards

a

File is opened for write only.

25
New cards

r+

File is opened for read/write.

26
New cards

a+

File is opened for write/read.

27
New cards

fgets()

A function is used to read a single line from a file.

28
New cards

file_exists()

A function checks whether a file or directory exists.

29
New cards

basename()

A function returns the trailing name component (the filename or final directory) from a given path string

30
New cards

mkdir()

Creates a directory/folder

31
New cards

chdir()

Change the current directory

32
New cards

opendir()

Open a directory, read its contents, then close

33
New cards

Still learning (19)

You've started learning these terms. Keep it up!