PHP warning: Division by zero
PHP will throw a “division by zero” warning (or exception) if your code attempts to divide a number by 0.
Read More...PHP will throw a “division by zero” warning (or exception) if your code attempts to divide a number by 0.
Read More...Fixing (and avoiding) the “Fatal error: Call to a member function on a non-object” error.
Read More...How to check to see if a valid MySQL connection is open or not.
Read More...This is a PHP error that happens whenever you attempt to use a scalar value as an array.
Read More...Fixing the issue with PHP being displayed in the browser.
Read More...In this article, we discuss why you should avoid mixing PHP and HTML.
Read More...This is a simple tutorial on how to download files with cURL in PHP.
Read More...This tutorial shows you how to use a custom user agent with the cURL functions in PHP.
Read More...This is a short guide on how to “fix” undefined index / offset errors in PHP.
Read More...This is a simple guide on how to check to see if session_start has already been called in PHP.
Read More...Pinging a website in PHP is pretty easy if you know how to use the function fsockopen.
Read More...This is a simple guide on how to expire user sessions in PHP after a set amount of time.
Read More...In this guide, we show you how to calculate the difference between two dates in PHP. We’ll also tell you how to convert it into other formats.
Read More...In this article, we look at at the fatal PHP error “class contains abstract methods”. We also give you tips on how to fix it.
Read More...This is a short guide on how to modify a JSON file with PHP.
Read More...A solution for preventing IE from caching Ajax results.
Read More...A simple guide on how to handle cURL errors in PHP.
Read More...A simple guide on how to send JSON via a POST request in PHP
Read More...This is a simple guide on how to loop through the characters of a string in PHP.
Read More...This is a guide on how to pass PHP arrays to JavaScript.
Read More...A simple guide on how to print out values in a PHP multidimensional array.
Read More...As you probably already know, PHP has an array called $_SERVER, which contains information such as: The server name. The request method (whether the request is POST, GET or PUT, etc). The IP address of the user. The visitor’s user agent. It has also has an index called HTTP_REFERER, which should give you the address of […]
Read More...In this article, we are going to look at why resizing images on upload is better than dynamically resizing them “on the fly”.
Read More...A simple guide to creating a Reddit-style “What’s Hot” page with PHP and MySQL.
Read More...In this guide, we are going to show you how to validate HTML forms using PHP.
Read More...One of the tricky things about being a web developer is that you are sometimes forced to accommodate visitors that use different measurement systems and formats. Currency symbols, date formats and measurement systems can all differ from one user to the next. The following PHP code snippets will help you to convert between some of […]
Read More...Simply put, there are no performance differences between using singles quotes or double quotes in PHP.
Read More...A comprehensive list of the best PHP / web development practises that every developer should know about.
Read More...In this tutorial, we show you how to send a HEAD request using PHP and cURL. This is useful if you need to check if a remote file exists.
Read More...Not so long ago, I came across a peculiar issue with PHP’s MySQLi extension. For some strange reason, using the string “localhost” in the constructor will sometimes result in an unexpected delay in connectivity. For example, connecting to MySQL will take 1-2 seconds. This is despite the fact that the DBMS is on a local […]
Read More...On too many occasions, I’ve come across developers using PHP loops to print out large amounts of JavaScript data. This seems to be particularly common among coders who are trying to generate multiple markers for the Google Maps API. Typically, they will grab a bunch of long / lat values from their database and then […]
Read More...On more than one occasion, I’ve come across novice PHP developers looking for ways to redirect the user and their submitted form variables to an external website. More often than not, they’ll ask if they can somehow attach POST variables to a header redirect. After this fails and they finally realize that another solution is […]
Read More...