PHP Object-Oriented Programming

In this lesson, you will learn about the basic features of object-oriented programming with PHP. The OOP is not a new way to write code, but it is entirely a different approach to writing code. With procedural language, the focus is on the actions whereas in OOP the focus in on the nouns. PHP and... » read more

PHP and JSON

In this lesson, you will learn how to use JSON with PHP for web development. What is JSON? JSON is a short form of JavaScript Object Notation. It is not a programming language itself; it is merely a data format which is used to exchange data between a server and a web browser. Now you... » read more

PHP Error handling

In this lesson, you will learn more about PHP’s way to handle errors and catch exceptions. Handling errors and exceptions in a progressive manner isn’t difficult and somewhat similar to how other C++ or Perl handle errors or catch exceptions. Error handling lets you catch errors caused by your code and taking appropriate action according... » read more

PHP Date and Time

In this lesson, you will learn about the date and time in PHP. Every web developer has to deal with time and date at some point. Displaying and manipulating times and date may seem simple, but as uses may live in different time zone and probably have a different way of understanding time formats, it... » read more

PHP File Upload

In this lesson, you will learn about how to upload files and images to the web server. This action is relatively easy to perform in PHP. When we mention files and images, we are talking about all sort of data and images on your computer such as MS word files, pdf files, images, etc. It... » read more

PHP Send Email

In this lesson, you will learn how to send emails using PHP. Send email using PHP Nowadays, almost every web application use mail functionality. Even simple one-page business websites have these contact forms where you enter your email, contact email, and message which goes directly to the business management or owner’s inbox. This looks convenient... » read more

PHP Sessions

In this lesson, you will learn how to create and use sessions for seamless user experience over a web application. The session is a crucial concept behind information persistence across all the pages of a website or app. Sessions in PHP A session keeps a piece of information available across the web applications to identify... » read more

PHP Cookies

In this lesson, you will learn about HTTP cookies in PHP. An HTTP cookie refers to the small piece of data sent by the web server to the user’s web browser. The browser may save it and sent it back to the web server with the next request sent. It can contain up to 4KB... » read more

PHP Functions

In this lesson, you will learn about functions in PHP. A function is a reusable piece of code that performs some kind of specific action. Mostly, functions take some kind of input data, process that data and return results when called. PHP gives over 700 built-in functions to make developers life easy. Why you will... » read more

PHP File Handling

In this lesson, you will learn how to interact with files using PHP. The database is not the only way to store all information on a web server. Sometimes it can be more efficient to store data on files rather than on the database. Other cases in which you may need to modify files, upload... » read more

PHP Get and Post methods

In this lesson, you will learn how to access and manipulate data submitted by users through forms. Information can be submitted through HTML forms to the same or another web page. To send submitted data through a form, one can use GET and post method to do that in PHP. GET and Post in PHP... » read more

PHP Arrays

In this lesson, you will learn how to create, access and, manipulate arrays. An array is a simple data structure which can hold multiple values in a continuous memory location. Let’s say you have to create a variable to hold a student’s marks. What if you have 100 students in the class? One solution is... » read more

PHP foreach Loop

In this lesson, you will learn how to use the foreach loop in PHP. The foreach constructs is an easy way to traverse all elements of an array. Introduction to foreach loop in PHP First, let’s start off with the syntax. PHP foreach can be written in 2 ways: foreach ( array_expression as $value) The... » read more

PHP while loop

In this lesson, you will learn how to use while loop in PHP. A ‘while loop’ let you run the same set of a statement(s) repeatedly until a condition is met. Introduction to ‘while loop’ in PHP The syntax while( expression ){ //statement } The expression in the while loop is checked at the start of... » read more

PHP for Loop

In this lesson, you will learn how to use loops in PHP code – especially the “For loop.” In php, loops are used to execute the same code for a specified number of times or until an expression is met. This would help developers to write a minimal code while avoiding repetition. Overview of for... » read more