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 Run PHP on MacThis tutorial introduces how to run PHP on Mac How to Print to Console in PHPThis tutorial introduces how to write to console in PHP How to Convert Object to String in PHPThis tutorial introduces how to convert an object to a string in PHP How to Get the Current Script File Name in PHPYour script may need the current file name with the directory name in which it is currently executing. How to Replace Space With Dash in PHPPHP provides three functions to replace string/array with another string/array in the string/array. How to Check if Key Exists in Array in PHPYour script may need the check if particular key exist or not to perform operation on value. How to Call to Undefined Function in PHPIn today's post, we are finding out how to unravel this error. How to Get Last Array Element in PHPThis article will explain how to extract the last element of an array in PHP How to Create Default Object From Empty Value in PHPThis tutorial will introduce how to get rid of the error creating default object from empty value in PHP. How to Check Type and Value of Null in PHPThis tutorial introduces how to check the type and value of null in PHP. How to Get the Current Month of a Date in PHPThis article introduces how to get the current month in PHP> How to Create the MM/DD/YYYY Date Regular Expression in PHPThis tutorial introduces how to create the mm/dd/yyyy regular expression in PHP How to Convert XML Into an Array in PHPThis tutorial introduces how to convert XML into an array in PHP How to Create Config Files in PHPThis tutorial introduces how to create config files in PHP How to Define an Empty Object in PHPIn this article, we will define an empty object in PHP. How to Subtract Days With PHPIn PHP, we use some functions to subtracts day, months, and years from a date. How to Write HTML Inside PHPThis tutorial introduces how to write HTML inside PHP 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 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.