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

PHP Variable in StringThis tutorial demonstrates how to mix a PHP variable with a string Difference Between the == and the === Comparison Operators in PHPThis tutorial introduces the difference between the double equals and triple equals comparison operators in PHP. One Line if Statement in PHPThis article introduce the one line if statement in PHP. PHP Zip ExtensionThis tutorial demonstrates how to install and use ZIP Extension in PHP. Undefined Index With PHP PostThis article teaches you four solutions to undefined index in a PHP post array. The solutions will use isset(), array_key_exists(), in_array(), and the Null coalescing operator. First, we'll reproduce the error and then we'll show you the solutions. Meanwhile, in PHP 8, undefined index is the same undefined array key. Session ID in PHPThis article will teach you how to work with PHP Session id. You will learn how to start and check for session ids using session_start() and session_id() PHP cURL File UploadThis tutorial demonstrates the complete execution of uploading curl file in PHP. PHP Video PlayerThis tutorial demonstrates how to create a video player in PHP. PHP Artisan Clear CacheThis tutorial demonstrates how to clear cache using artisan in Laravel PHP. PHP Anonymous ClassThis tutorial demonstrates how to create and use an anonymous class in PHP. PHP Spread OperatorThis tutorial demonstrates the spread operator in PHP. Warning: Php_network_getaddresses: Getaddrinfo Failed: No Such Host Is KnownThis article shows solution for the php_network_getaddresses: getaddrinfo failed warning in PHP. this and self in PHPThis tutorial explains what OOP is, and how and when to use this and self in your PHP code. Static Variables in PHPThis article will give you a clear overview on static variable in PHP. Null Coalescing vs Elvis Operator in PHPThis article will describe the difference between Elvis operator and Null coalescing operator Method Overloading in PHPThis tutorial introduces method overloading in PHP. cURL GET Request Using PHPThis tutorial explains and details how to carry out GET request operations in PHP using cURL. Different Ways to Compare Dates in PHPcompare dates in php with strtotime(), time(), date() and DateTime object PHP PaginationThis tutorial introduces how to paginate the database rows in PHP Lambda Functions in PHPThis tutorial demonstrates how to use lambda or anonymous functions in PHP. PHP Error HandlersIn this tutorial, we will introduce the PHP Error Handling. We will cover the importance of error handling on PHP and how it works. Encode Image to Base64 in PHPThis article will teach you how to encode image to base64 in PHP. You'll use a combination of functions like pathinfo, file_get_contents, base64_encode, and mime_content_type in PHP. PHP Switch Version on UbuntuThis tutorial demonstrates how to switch PHP versions of Ubuntu using the command line. PHP Private FunctionThis tutorial demonstrates how to create and use private functions in PHP.