PHP PDO Tutorial to Connect MySql Database

How to connect MySql Database using PHP PDO (PHP Data Objects). What’s the advantage of using PHP data objects.

PHP PDO (PHP data objects) is a database access layer providing a uniform method of access to multiple databases. PHP Data Objects is written to provide a consistent API.  Before MySqli and PDO, we used MySql API to connect MySql Database. Let’s see how PDO is better than MySql Api.

Regular Expression (Regex) Tutorial, Tools, Tester, Syntax

What is Regular Expression

In simple words it is a pattern of symbol and characters. Regular expression is used to search,replace or modify the words/strings. It is the most important part of your daily programming usage whether rewriting url using .htaccess, form validation, validating user input etc.

Regular expression is a sequence of characters and each characters has it’s special meaning. Let’s look at some basic characters and it’s meaning.

Magic Methods in PHP

What are PHP Magic Methods?

PHP Magic methods are a specialized method that is executed in response to a specific event. Each magic methods start with two underscores(__) and it is called automatically when a certain condition is met. It triggers custom behaviors defined by a programmer inside the class. Some of the magic methods are __construct(), __destruct(),  __toString(),  __get(),  __set(), __call() etc.

In this tutorial, we are going to explore php magic methods.

PHP Magic Methods

PHP Magic Methods