Installing PHP on Windows

What is PHP? PHP is known to be one of the most commonly used server-side programming language on the web. It provides an easy to master with a simple learning curve. It has close ties with the MySQL database, and various libraries to cut your development time. Two Ways to install PHP locally There are several ways that we could install PHP locally. Here i have added two of the…

PHP Array Functions and their usage with examples

This tutorial is created to give an abstract idea about commonly used PHP array function with examples. Through this tutorial you'll be able to know, how to use array functions to make code more short and simple. Note:I'll be only covering some of the basic array functions, Which were frequently used by PHP developers. You can refer all the array functions from the official PHP Documentation. Feel free to share your opinion…

PHP Program to remove empty or specific array elements.

This tutorial is created to remove specific or empty (NULL) array elements from the array. array_filter() to Remove Empty Elements array_filter() function removes false values when declared using a callback function, however, If the callback function returns true, the current value from input is returned into the result array. $array (mandatory): This is where the input array is given.$callback_function (optional): The user-defined function is given . If the function is not given…

Simple PHP MySQL CRUD Application

PHP is widely used by many developers today and it's one of the easiest language to learn. This tutorial will help you to learn the basic CRUD (Create, Read, Update, Delete) operations in PHP using MYSQL. Create the DB(Database) file Create the DB as 'php_crud' and run the following SQL query to create table users inside the MySQL 'php_crud' database. Creating the DB SQL query to create a table named…

Simple PHP Page Router

This is a simple yet basic PHP routing application created to direct all request to index.php and route the files to it's relevant paths. Create the Configuration file In the root directory, Specify the configuration by creating a .htaccess file to redirect all requests to index.php. .htaccess RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ index.php [QSA,L] Create the Router Specify the pages you want to…

Convert PHP Array To JSON : Examples

This tutorial focuses on converting PHP Array to JSON. It is used to read data from the server and display it to the Web. JSON is a text format , and We can convert any JS Object into a JSON format. Covert PHP array to JSON PHP is capable of handling JSON and it has some built-in functions to handle them. json_encode() is used to convert objects, arrays in PHP to JSON…