A problem with WordPress’ built-in picture gallery is that it will include a featured image in the gallery itself if one exists. See the solution
There are multiple ways to read files with PHP. You can use
file(), file_get_contents(), fsockopen(), or fopen() functions. If you want to read through a file line by line, though, you will want to use one of the latter two and use their pointer to navigate through your file. Get the code.
Hmmm… should you use
POST as the method for your HTML forms? Neither! You should be using
post, actually. While the world will keep on spinning no matter how you capitalize the word, all attribute values should really be lowercase for consistency. (more…)
It occurred to me that there are many wrong ways to submit forms and I can’t recall that I have every seen the right way documented anywhere.
Here, SolidlyStated will show you a 3 step, rock-solid form submission process and why it is superior to the majority of the web. Learn the steps.
As with many things in PHP, manipulating strings can be handled a number of ways. I often find myself creating a string of items from an array for presentation on screen or entry into a database. I figured now would be a good time to explore the best method of removing that pesky comma that usually ends up at the end of a looped string (which just so happens to be the wrong way of going about it). The proper way
It has been three years ago this month that PHP 5.3.0 was released and quite a few legacy functions became deprecated. Since I have my hands on a serious amount of aging enterprise projects, I can without a doubt say that the most common deprecated function I see is
split(). Upgrade your code inside.
Almost every good PHP application will be need to access some global values at some point. Constants are a programming pattern that you can access anywhere, at anytime and be sure that it won’t be overwritten. You will find this universal concept in almost every programming language. In this article, I will consolidate some great tips for working with constants in PHP and the specifics to keep an eye on. All about constants.
I created some nice work week-related functions in PHP that will calculate and return the next available work day, based on any particular date and number days from that date. These were helpful for me in scheduling,appointments, or deadlines for users and clients that are open only Monday-Friday for a 5 day work week. Get a date!
Date-related PHP can be one of the more… frustrating aspects of scripting. Whereas match calculations are the same no matter when or where you perform them, date calculations might appear to work properly in development and then fail later when you aren’t looking. Don’t forget your timezones!