How do I use PHP to get the current year?
Display the current year using PHP, the easy way!
Learn this dev tipDisplay the current year using PHP, the easy way!
Learn this dev tipA quick way to get your version of PHP in your script and compare it against it.
Learn this dev tipLearn how to remove all spaces from a string using PHP's str_replace function, a quick and easy guide.
Learn this dev tipDiscover the best way to use PHP to get the same functionality as MySQL's NOW() function.
Learn this dev tipGet the full URL in PHP the easy way. Learn how it works and how you can display, use, and take advantage of knowing the URL path in your application.
Learn this dev tipGet the current date and time in PHP with this quick and easy tip. Learn the parameters and how to convert Unix timestamps to readable dates.
Learn this dev tipHow to get PHP errors to display to your web browser the easy way! Enable error reporting and you'll be away, fixing those PHP bugs.
Learn this dev tipGet the first element of an array quickly and easily in your PHP code. A complete how-to guide on how you can get hold of the first element.
Learn this dev tipThe easy way to delete an element from an array, with example code for different types of arrays.
Learn this dev tipConvert an integer to a string the quick way with PHP. Discover example PHP code and best practices along the way.
Learn this dev tipThe quickest and easiest way to convert a date format in PHP using date and strtotime functions.
Learn this dev tipWondering what PHP projects to include in your dev stack, we've got you covered, with a collection of the best PHP dev tools.
Learn this dev tipLearn how to remove whitespace from the beginning and end of a string, easily and safely with PHP's built-in trim function. Great for user-inputted data and ensuring a string's before and after are clean.
Learn this dev tipLearn how to make character replacements on a string along with how to make multiple value replacements at the same time, all with PHP code examples.
Learn this dev tipLearn the true power of arrays from what they are to how they work, in this complete guide to PHP arrays.
Learn this dev tipThese top three PHP-ready Apache modules are a great starting point for your web application. From performance to custom headers, this guide is for you.
Learn this dev tipRestart your Apache webserver with these easy-to-learn commands, suitable for Ubuntu, CentOS, and Bitnami. With instructions on how to restart on Plesk and cPanel.
Learn this dev tipExplore how the array_pop function works, common errors, and how multidimensional arrays work. This tutorial is packed with PHP code examples and common error prevention.
Learn this dev tipLearn how to use the array_walk function in PHP and how it could help you perform custom logic against each array element.
Learn this dev tipWe explore all the new features, performance upgrades, and deprecations in PHP 8.3, and code examples of each.
Learn this dev tipUse PHP to check if a string is a number using the simple-to-use is_numeric function. Learn how it works and the different types of numbers that pass as numeric.
Learn this dev tipSplit a string into parts by a given type of character using the PHP explode function. Take a string and learn how to split it into a usable array.
Learn this dev tipExploring the powerful Laravel Artisan command line tool to manage and maintain your application database. Learn what all the commands do and how they could help you.
Learn this dev tipExplore how you can use the cosh function in PHP to work out the exponential growth of numbers using the hyperbolic cosine formula.
Learn this dev tipDiscover how to use escape sequence indicators and the most common characters you'll use to escape strings in PHP.
Learn this dev tipLearn how to use readonly properties and classes in PHP 8.1 and 8.2 and higher. Discover how to use the key PHP keyword along with code examples.
Learn this dev tipLearn how to prevent one of the most common errors in PHP, array-to-string conversion warning. Find out how it occurs and how to fix it.
Learn this dev tipFind out how to use execution operators in PHP and understand why using them might be more beneficial than the PHP exec function.
Learn this dev tipUsing PHP's cURL library, learn how to send a POST request with JSON data to an API service or similar. Learn how to set cURL options including how to create JSON object from an array.
Learn this dev tipSending emails using PHP Mail is a useful and practical skill for any web developer. In this comprehensive guide, we take you through the process of writing your first email using PHP Mail. We break down each of PHP's mail parameters one-by-one to help you understand what they all do.
Learn this dev tipDiscover how to use the PHP linkinfo() function to retrieve valuable information about links in a file system, including the inode numbers to help improve your file management code in PHP.
Learn this dev tipThe complete step-by-step guide on instructions on how to install PHP on Windows 10 and 11, enabling you to code web applications on your Windows machine.
Learn this dev tipWe explain how the dechex() function in PHP works and how it can be used to convert decimal numbers to their hexadecimal equivalent, including what decimals and hexadecimals are in computing.
Learn this dev tipExplore how the PHP clone method works and how to create copies of objects, including how to prevent certain properties from being cloned.
Learn this dev tipLearn how to use PHP's null safe, ternary, and coalescing operators to write cleaner, more efficient code. Discover their syntax, use cases, and tips in this guide.
Learn this dev tipExplore how to make the first letter of a string uppercase with the powerful ucfirst PHP function. Highly common PHP function that you should master!
Learn this dev tipLearn how to debug and increase your code's performance by examining all the included files for a given PHP script.
Learn this dev tipExplore how you can add PHP comments in your code, learn the different styles and get familiar with PHPDoc style type hinting.
Learn this dev tipLearn the basics of simple cryptography with the RO13 algorithm using the str_rot13 PHP function.
Learn this dev tipQuickly and easily check if a string ends in a certain sub-string using PHP 8's str_ends_with function. Available since PHP 8, learn how it works with code examples.
Learn this dev tipLearn how in either OOP or in a procedural style, to get the total found results from a MySQL query with PHP.
Learn this dev tipAssigning variables can sometimes be a long process when having to do it repetitively. Learn how using the list function in PHP can save time and make your code easier to read.
Learn this dev tipThe max function in PHP is an efficient way to find the maximum value among a group of provided values. Works with integers, floating-point numbers, and arrays, learn how it works.
Learn this dev tipRedirecting a user to another location in PHP by using the header function is straightforward in this complete PHP redirection guide.
Learn this dev tipWorking with PHP's magic constants is a great way to speed up your coding. Learn how to use them along with code examples to show you how they all work.
Learn this dev tipReleased in PHP 8.1, the "never" return type in PHP core allows developers to indicate that a function will not return a value. We'll explore how it works along with code examples.
Learn this dev tipComparing two strings for similarities is a common part of building PHP applications. We will explore how the similar_text works and some of its possible drawbacks.
Learn this dev tipFinding a string in a substring is a very common task in PHP. Learn how to do this in both PHP 8 and above and PHP 7 and below, all with code examples.
Learn this dev tipDebugging in PHP is a critical part of programming. Learn how to debug the right way with PHP's built-in function var_dump and how it can speed up your coding.
Learn this dev tipWhy does PHP use the dollar sign ($) to prefix variables in its language? Explore why there are important and how you can use them.
Learn this dev tipThe most important syntax type in PHP, the dollar sign, is how you create a variable, but did you know you can also create variable variables in PHP? We'll learn how this is possible and why this might be beneficial.
Learn this dev tipFind out how to round a number down to the nearest lowest number with the PHP floor function. Code examples to showcase the differences with other similar differences round and ceil.
Learn this dev tipWorking with numbers, floats, and integers in PHP might seem daunting, but with the ceil function in PHP, you'll learn that this is not the case.
Learn this dev tipThe best and easiest way to prevent the undefined array key warning in PHP along with easy-to-follow code examples, and alternative ways to fix this common warning error.
Learn this dev tipConverting a PHP string into lowercase cannot be any easier with this easy-to-follow guide, with easy-to-understand accompanied code examples.
Learn this dev tipLearn how to remove a file with the PHP function unlink. With our easy-to-follow code examples, discover the best way to delete a file and tips as to why it might not work, due to permissions.
Learn this dev tipArrays in nearly all programming languages are an integral part that will make up your application. Manipulating these arrays is key to getting the most out of your application. Learn how to reset keys and values in this handy PHP guide.
Learn this dev tipYour server's filesystem at some point in your web application lifecycle will require you to create, modify, or delete files and folders. We explore how with PHP you can remove a directory using PHP's rmdir function, along with PHP code examples.
Learn this dev tipWithin PHP there will be many times when you will need to count an array or object that implements the Countable interface. Using count is a fast and effective way to count elements in PHP.
Learn this dev tipYour server's filesystem at some point in your web applications lifecycle will require you to create, modify, and delete files and folders. We explore how with PHP you can create a fresh directory using just PHP's mkdir function.
Learn this dev tipPHP is a hugely popular server-side programming language used in web development. In order for it to work, it requires a server. The server is responsible for handling tasks and processes. In this guide, we will delve into the reasons why PHP needs a server and what exactly is meant by "back-end code".
Learn this dev tipHave you ever wanted to run a PHP script from the command line, but weren't sure how? In this tutorial, we'll walk you through the process and explain how to execute a PHP script in CLI and to ensure it cannot be executed from an HTTP request.
Learn this dev tipLearn how to extract file names from file paths using the PHP's built-in basename function on both Windows and Linux servers. This guide will show you how to use the function and more.
Learn this dev tipPHP has a lot of inbuilt variable handling functions and the empty function is one of them that will enhance your code. Find out what it is used for and how to use it, along with PHP code examples.
Learn this dev tipPHP sessions are a popular way to store per-user data, that is kept server-side. But how secure are they, and what is the best way to use PHP sessions and keep data and users safe?
Learn this dev tipIn nearly all cases you will want your PHP scripts to be instant, but there are times when pausing the execution is important for the task at hand. Learn why this might be useful and how to use the PHP sleep function.
Learn this dev tipWhat is the easiest and quickest way to format a number to lead with zeros in PHP? Find out how and learn about some common pitfalls along the way plus find out the fastest method on the latest PHP versions.
Learn this dev tipHow do you leave a foreach early once you've found the item you're looking for when processing an array of objects? Find out how you can, plus we've added extra bonus performance tips.
Learn this dev tipSometimes you need a quick way to block an IP address that is performing unwanted attacks on your server or website. To block specific IP addresses is quick and easy with htaccess in Apache-based servers.
Learn this dev tipFind in-depth guides to the most common PHP programming questions and other areas of web programming, such as blocking IPs with Apache. Learning how to code is a great way to understand how the web work, and to have more control over your own websites. That means you're not reliant on other technologies such as web builders and will have an understanding of how it works. With any form of programming, there will always be times when you might get stuck. That's why we created this website - to share our knowledge and experience with you, so you can find answers to your questions quicker and learn from our mistakes. Our guides are written by experienced PHP developers with years of experience, and provide clear and concise explanations, practical examples, and expert advice. We hope that our guides will help you to improve your skills, solve problems, and build better web applications.
★ API development ★ WordPress ★ Hosting ★ and more 🐘