An operating system is the low-level software that schedules tasks, allocates storage, and handles the interfaces to peripheral hardware, such as printers, disk drives, screen, keyboard, and mouse. An operating system has two main parts: the kernel and the system programs.
A session is a way to store information in variables. A PHP session stores data on the server rather than user's computer. In a session based environment, every user is identified through a unique number called session identifier or SID. The session IDs are randomly generated by the PHP engine which is almost impossible to guess.
At their simplest, objects are data types. You can compare objects with the equal operator, which is two equal signs (==), or with the identical operator, which is three equal signs (===). Using the equal operator, two objects are equal if they are created from the same class and have the same properties and values. However, using the identical operator, two objects are identical only if they refer to the same instance of the same class.
PHP provides a method you can use to copy an object. The method is __clone, with two underscores. You can write your own __clone method in a class if you want to specify statements to run when the object is copied. If you don’t write your own, PHP uses its default __clone method that copies all the properties as is.
PHP provides an error-handling class called Exception. PHP 5 introduced new object oriented way of dealing with errors. Exceptions are used to change the normal flow of a script if a specified error occurs. Exception handling is used to change the normal flow of the code execution if a specified error (exceptional) condition occurs. This condition is called an exception.
When applications start growing, representing more complex data structures becomes necessary. Primitive types like integers, strings, or arrays are not enough when you want to associate specific behavior to data.
Object oriented programming (OOP) is an approach to programming that uses classes and objects. In object-oriented programming, the elements of a script are objects. The objects represent the elements of the problem your script is meant to solve. For example, if the script is related to a used-car lot, the objects are probably cars and customers. Or if the script is related to outer space, the objects would probably be stars and planets.
PHP can be used to handle files on the server. You can create, access (or read) and manipulate files dynamically using the PHP file system functions. Since PHP is a server side programming language, it allows you to work with files and directories stored on the web server. To work with a file, first you need to open the file.
Loops are control structures that allow you to execute certain statements several times, as many times as you need. Loops are used frequently in scripts to set up a block of statements that repeat. The loop can repeat a specified number of times. The most common use is when interacting with arrays. For example, imagine you have an array with elements, but you do not know what is in it. You want to print all its elements, so you loop through all of them.
PHP tries to be helpful when problems arise. It provides different types of error messages and warnings with as much information as possible. An understanding of errors will help you quickly recognize where problems exist in your code, which will lend to faster debugging and understanding where to look for problems.
Dates and times can be important elements in a web database application. PHP has the capability to recognize dates and times and handle them differently than plain character strings. Dates and times are stored by the computer in a format called a timestamp. Three important functions are date(), time() and strtotime().