What is PDO? Other than procedural methods like MySQLi, PHP also provides an object oriented approach to deal with databases. This framework is widely known as PDO: PHP Data Objects. Advantages of PDO PDO is applicable on 12 different databases whereas MySQLi is not, which makes PDO more flexible than typical procedural approach. PDO also … Read more

PHP Regular Expressions

What is Regex? Regular expressions (regex) are a sequence of specific characters itself. Generally the regex consists of arithmatic operators & alphanumeric characters to construct specific patterns. These patterns are widely used for customized validation as per user requirement. Functions PHP provides us three functions to deal with regular expressions: preg_match: The function is used … Read more

PHP Creating Image

In PHP there have many predefined function which helps to create background image and write text in the image. Like create CAPTCHA image for website.  Program:

Output Explanation: Firstly if user write any image code in PHP script need to set content-type:image/jpeg. Because by default PHP script content type is text/html. Browser only read … Read more

PHP Date and Time

Current date and time can get using PHP function. User registration time or want to know the user last login time, booking date or time for order product etc all are possible to get by date() function in PHP. Date function syntax


Explanation date() function has many different parameters. All different parameters … Read more

PHP Session

What is Session? Session means a period of time. Day start from 12.00AM and end 11.59PM, during this period 12.00AM to 3.59AM is a mid-night session, 4.00AM to 7.59AM morning session, 8.00AM to 11.59AM day session and similarly goes on. In PHP session is much similar to this. When a user opens an application do … Read more

PHP Cookies

The cookie is a mechanism to store data in the browser for a long time. It is a small data that server embeds on the browser. When a user opens any sites or does some activities in it and next time when he/she open the same website server can identify easily the user. Because browser … Read more

Functions in PHP

A function is a block of code that can be used many times in a program. It helps us to save a lot of codes and time because function defines only one time and we can use it multiple time whenever & wherever we want. The most important reason for using function is ‘Reusability’. Consider … Read more

Array in PHP

An array is a data structure or a collection of data that contains a group of elements under same name. Typically these elements are all of the same data types or different data types. for example:If a complex has thirty flats each flat having same features then the whole complex is considered to be an … Read more