Practical solutions

PHP Howtos How-To Guides

Solve the problem. Keep building. Collection of PHP how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Move File to a Folder in PHPThis tutorial demonstrates moving a PHP file from one location to another using rename function. How to Get Class Name in PHPThis tutorial will teach you how to get a class name in PHP. You will use get_class(), PHP class constant, and ::class in an object. How to Format a Number to a Dollar Amount in PHPDifferent methods can format a number to a dollar amount in PHP, like using number format, format currency, or a regular expression. How to Select Count Function From a MySQL Table in PHPThe select count(*) function can count rows and get the total records returned by a query from a MySQL table in PHP. How to Create and Get PHP Class ConstantsThis tutorial will teach you how to create and get class constants in PHP. You will use the const keyword, PHP access modifiers, and the final keyword. Also, you'll learn how to emulate class constants with static variables. How to Filter Arrays in PHPThis tutorial will teach different methods you can use to filter arrays in PHP. The methods will use PHP built-in functions like array_intersect_key, array_filter, array_keys, and array_flip. How to Double Question Mark in PHPThis tutorial demonstrates the uses of double question mark in PHP. How to Loose and Strict Equality Checks in PHPThis tutorial will teach you how to perform loose and strict equality checks in PHP. You'll use PHP built-in equality signs like double equal, not equal and use the strict versions of these checks. How to Compare Strings Using == Operator and STRCMP Function in PHPThis article shows how == operator and the strcmp function can compare strings in PHP. Array_map and array_walk Functions in PHPThis article shows us how the array_map and array_walk functions can modify elements in an array. How to Go Back to an Article Tag With an ID From the Action PageThis tutorial demonstrates how to go to another php page and come back to the same tag of action. How to UPDATE Query in a MySQL Table in PHPThe PHP UPDATE query can update existing records in a MySQL table. How to Insert Form Data Using MySQL Table in PHPThis article shows how the POST statement can send form data to table in a database. The use Keyword in PHPThis article describes use and namespace in PHP How to Execute Multiple MySQL Queries in PHPThis tutorial will teach you to execute multiple MySQL queries with PHP. You'll execute the queries with PHP prepared statements and multi_query, a built-in PHP function. How to Print Array Keys in PHPThis tutorial will teach you different methods you can use to print the keys of PHP arrays. These methods will use the foreach loop and the array_keys function. How to Merge PDFs in PHPThis tutorial demonstrates how to merge multiple pdf files using PHP. How to Send Data in URL to View the Single Record of a Selected ProductThis tutorial shows you how to dynamically send data in URL(s), retrieve the user's selected product records and make them viewable on the product.php?pid='id_value'. Learn how to fetch data from SQL using MySQL and PODS. How to Run Shell Scripts in PHP and Open Shell FileThis tutorial will demonstrate how to run shell scripts in PHP. We will implement our script using PHP's shell_exe() and shell() functions. How to Delete Cookies in PHPThis article introduces how to delete cookies in PHP How to Use HTML Image Tag Inside PHPIn this article we'll discuss how to use HTML image tag inside PHP, store a URL in a variable and echo it directly in the source and use the str_replace() function for URL conversion while using the iframe tag in PHP. How to Set Environment Variable in PHPThis tutorial is an illustrated step-by-step guide that teaches you how to set the environment variable for PHP in a local development environment like WAMP. How to Fetch Data From Database and Show the Data in the HTML Table Using PHPWe will learn the process of creating a database and table in MySQL and how to retrieve the mysql table dynamically and show it in the HTML. How to Create a Signature From Hash_hmac() and Sha256 in PHPWe will create string based keys and turn them into secret signatures, we will use hash_hmac() method with some of the most common HMAC methods for crypotographic conversions. We will also create a complex signature using sha256 and hex2bin and bin2hex functions in PHP.