Why Do You Need PHP FastCGI Process Manager?

By Elvis Plesky; November 3, 2020 PHP-FPM (an acronym of FastCGI Process Manager) is a hugely-popular alternative PHP (Hypertext Processor) FastCGI implementation. As you may or may not know, PHP is one of the biggest open-source software programming languages utilized online. It features heavily in web development across such well-known platforms as Drupal, Magento, and WordPress, and was originally devised … Read more

PHP Tutorial

Welcome to the modern PHP tutorial! This PHP tutorial helps you learn how to develop dynamic websites and web applications using PHP from scratch. PHP is one of the most popular programming languages for web development. PHP allows you to develop various web applications, including blogs, content management systems (CMS), and online stores.

How to create Pagination with PHP and MySQL

<html> <head> <title>Pagination</title> <!– Bootstrap CDN –> <link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css”> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js”></script> <script src=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js”></script> </head> <body> <?php if (isset($_GET[‘pageno’])) { $pageno = $_GET[‘pageno’]; } else { $pageno = 1; } $no_of_records_per_page = 10; $offset = ($pageno-1) * $no_of_records_per_page; $conn=mysqli_connect(“localhost”,”my_user”,”my_password”,”my_db”); // Check connection if (mysqli_connect_errno()){ echo “Failed to connect to MySQL: ” . mysqli_connect_error(); die(); } … Read more

How to convert MySQL data to JSON using PHP

<?php // Initialize variable for database credentials $dbhost = ‘hostname’; $dbuser = ‘username’; $dbpass = ‘password’; $dbname = ‘sakila’; //Create database connection $dblink = new mysqli($dbhost, $dbuser, $dbpass, $dbname); //Check connection was successful if ($dblink->connect_errno) { printf(“Failed to connect to database”); exit(); } //Fetch 3 rows from actor table $result = $dblink->query(“SELECT * FROM actor … Read more

How To Remove HTML Tags In PHP & MySQL – Simple Example

To remove HTML tags in PHP, we can either use the strip_tags() or htmlentities() function: The strip_tags() function will remove all HTML tags. For example, $clean = strip_tags(“<p>Foo</p> Bar”); will result in Foo Bar. The htmlentities() function will not remove but convert all symbols into HTML entities. For example,  $clean = htmlentities(“<p>Foo</p>”); will result in &lt;p&gt;Foo&lt;/p&gt; Lastly, we can also create a stored function in MySQL to strip HTML … Read more

How to Check if User is Logged In WordPress (PHP Function)

Sometimes you want to add functionality or display something only for logged in users. This is easy using WordPress’ built-in is_user_logged_in() function. This quick tip will show you how to check if a user is logged in WordPress. Here’s an example using the is_user_logged_in() function to display a logout link for logged in users and a login link … Read more

Smarty

Smarty is a template engine for PHP Latest version: 4.1.0 (released on Feb 06, 2022) Added support for PHP 8.1. Smarty version 2.6.20: Smarty.class.php 2722 2007-06-18 14:29:00Z danilo Smarty Crash Course Variable Modifiers Smarty 4 Documentation Smarty 3 Manual Smarty on github Smarty 3 Overview: Rewritten for PHP 5 The Smarty 3 code base is a … Read more

Create Simple RESTful API with PHP & MySQL

In this tutorial you will learn how Create Simple RESTful API with PHP and MySQL. We will implement REST API with CRUD operations to create items, read items, update items and delete items. We will cover this tutorial step by step with live example to create RESTful API to perform CRUD (Create, Read, Update, Delete) operations … Read more

Build a Simple REST API in PHP

REST APIs are the backbone of modern web development. Most web applications these days are developed as single-page applications on the frontend, connected to backend APIs written in various languages.