How to Control CSS Variables with PHP

CSS doesn't have support for variables like a programming language does, by default. However, there are a couple of things that can be done to incorporate variables into CSS styles. In this tutorial, I will demonstrate how to add dynamic styles to CSS with the help of PHP variables. Read more...

How to Check If File Input Field is Empty with PHP

There are a number ways for checking if a file input field is empty or not, or making it as a required field. In this tutorial, I will show you how to check if a file is selected in a file input field with PHP for those who need to implement server side validation of this kind. Read more...

How to Get the Subfolders in a Folder with PHP

When you are working on a website with many folders and subfolders, it may be handy to know how to access the subfolders within another folder. In this detailed tutorial, I will demonstrate how to get all the subfolders in a folder using a PHP script. Read more...

How to Get the Number of Files in a Folder with PHP

In this tutorial, I will demonstrate how to get the number of files (and subfolders) in a folder using a simple PHP script. Read more...

How to Get All Files in a Folder with PHP

In this quick tutorial, I will show you how to get all the files in a folder with PHP and store that information in an array that you can then use as you wish. Read more...

PHP Image Watermark: How to Add a Watermark to Images in PHP

It is possible to programmatically add a watermark (by using a watermark image) to your images with PHP. In this tutorial, I will demonstrate how to do that by giving an example. Read more...

Simple PHP-MySQL Database Connection Class Using mysqli

In this PHP tutorial, I will demonstrate how to write a very simple MySQL database connection class to connect to the database on your website or web application, using the mysqli (MySQL Improved Extension) functions. Read more...

PHP Basics Part 5: Testing PHP Scripts

In this post, I will talk about how you can test your PHP scripts once they are ready for testing and mention some common issues you may encounter. Read more...

PHP Basics Part 4: PHP Syntax

In this post I will talk about PHP syntax such as how to insert PHP into HTML files and how to add comments in PHP by giving some examples. Read more...

PHP Basics Part 3: How PHP Works

In this post, I will continue with talking about how PHP works and what requirements it has to work on your system/server. Read more...