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 Export MySQL Table to Excel in PHPThis tutorial introduces how to export MySQL table to Excel in PHP How to Differentiate Single and Double Quotes in PHPThis tutorial differentiates the single and double quotes in PHP How to Push Both Value and Key Into PHP ArrayThis article introduces how to push both value and key into a PHP array How to Use Foreach Loop in Multidimensional Array in PHPThis tutorial introduces how to use a foreach loop in a multidimensional array in PHP. How to Check if Post Exists in PHPThis article will teach you how to check if post exists in PHP with isset(), empty(), negation operator and empty string check How to Set Up a Search System With PHP and MySQLThis tutorial will teach you how to set a simple search system with PHP and MySQL. You will learn how to create a MySQL database and how to use a prepared statement with the LIKE operator in SQL. How to Fetch MySQL Results With PDO in PHPThis tutorial teaches you how to fetch results from a MySQL database with PHP PDO. You'll use PDO methods like fetchall() and fetch() and learn how to iterate over the PDO results with a while loop. How to Encode HTML in PHPThis tutorial will teach you how to encode HTML in PHP. You will use htmlspecialchars(), htmlentities() and a custom method. 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 Check if Array Contains a Value in PHPThis tutorial demonstrates how to check if array contains a particular value using a built-in function 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.