PHP Inheritance

Inheritance is a wonderful feature of OOPS. It is solved the duplication of code. Code duplication happened when user uses same code multiple times. Using Inheritance declare the logic in one class and extends it whenever needs to use it. And also add new functionality with old one. In Inheritance, there have parent or base … Read more

PHP Constructor and Destructor

If the user wants to access any member function of a class then he or she must create the object first then call the member function by this object. The constructor is a method or way which automatically called when an object the for a class. No need to call it by an object. Simply constructor is a … Read more

PHP Class and Objects

Class and objects is a programming template to write a program in a block. It is helps to developer write complex program in simple way, reuse a program in multiple applications and create a structural program. A class has two member one Variables and two Functions. A class is a program structure where developer defines … Read more

PDO in PHP

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 text … 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

Output

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