You are on page 1of 2

1. What is PHP File inclusion?

Php file inclusion, which is often referred to as "include" or "require," enables you to insert the
contents of one PHP file into another PHP file before the server executes it. Include and
require are the two primary PHP functions for including files. This is a feature of PHP that
makes it easier to create components, headers, footers, and functions that are reused on
different pages. This will assist developers in making it simple and low-effort to alter the layout
of a whole website. If any changes are needed, just make the included file changes rather
than altering hundreds of files. Their approaches to handling mistakes distinguish them from
one another. In the event that the file cannot be located, require will produce a fatal error and
stop the script's execution, whereas include will offer a warning and continue.

2. What is PHP File & I/O?


PHP file and I/O refer to the functionality and features associated with input and output
operations on files. In PHP, a file is referred to as a "resource" that may be supplied to and
read from by other functions. Reading and writing text or binary data to files, creating, opening,
and closing files, adding data to already-existing files, verifying file characteristics and
permissions, and manipulating files are examples of common file and I/O operations in PHP.

3. What is Cookies and Session?


In web development, cookies and sessions are frequently used to save and manage user data
and states in many client queries to the web server. A cookie is a short text file that can only
hold 4KB in size and is saved on the user's computer. Other names for it include web, internet,
and HTTP cookies. It is a type of data packet that a website delivers to a user's computer
when they first visit it. A session is used to temporarily store data on the server so that it may
be used on other website pages. A user session starts when a user registers into a particular
network application and ends when the user logs out of the program or shuts down the
computer.

References
CodeAhoy (n.d.), File I/O in PHP, viewed 03 February 2023,
https://codeahoy.com/learn/php/ch14/

GeeksforGeeks, December 2022, Difference between Session and Cookies, viewed 03


February 2023, https://www.geeksforgeeks.org/difference-between-session-and-cookies/

Tutorialspoint (n.d.), PHP – File Inclusion, viewed 03 February


2023, https://www.tutorialspoint.com/php/php_file_inclusion.htm

You might also like