PHP stands for "PHP: Hypertext Preprocessor". It is a widely-used Open Source general-purpose scripting language especially suited for web development. It can be embedded into HTML. The main goal of the language is to allow web developers to write dynamically generated web pages quickly, but you can do much more with PHP.
The filter_var() function filters a variable with the specified filter. There are two types of filters:
The strstr() function and stristr() function can find the first occurrence of a substring (second parameter) inside another string (first parameter), and return all characters from the first occurrence till the end of the string.
Before you can access data in the MySQL database, you need to connect to the server.
You can use the array_pop() function to remove an element or value from the end of an array. The array_pop() function returns the last value of array. If the array is empty (or the variable is not an array), then the returned value is NULL.
The function uses Document Object Model to get array of any attribute values of particular tag element from the HTML. You can also get values from specific tags that have particular attribute and value.
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.
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.
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().
With PHP, you can connect to and make changes in the databases. The data in a MySQL database are stored in tables. A table is a collection of related data, and it consists of columns and rows. Databases are useful for storing information categorically.
For example, a company may have a database with the following tables - Employees, Products, Customers, Orders.
There are a lot of situations where you might need to get the URL of a webpage that any user might be currently visiting. For example, you may require you to dynamically generate the title of a webpage based on its URL. There are many ways in which you can obtain the URL of a webpage.