PHP Fix “Warning: Cannot modify header information – headers already sent”

If you’re here, it’s probably because you are looking for answers to why you are seeing the error Warning: Cannot modify header information – headers already sent being generated from your code. There are many reasons that this can happen. Answers below…

Why Does “Notice: Undefined Variable” or “Notice: Undefined index” all of a sudden show up in my PHP Code?

It’s a beautiful day, you make it to work and all of a sudden, out of no where, see PHP Notices like Notice: Undefined Variable, Notice: Undefined index, or Notice: Undefined offset. These errors might look something like the example below:

Tutorial – How To Change The WordPress “Read More” Anchor in Your Post

I recently had come across a challenge in this very WordPress site. I needed to change the “Read More” anchor tag in my posts so that I could leverage certain functionality I wanted to implement. The standard “Read More” anchor looks something like this <span id=”more-{id}”></span>. I wanted to add some content inside of the […]

Tutorial – Install PHP 5.4 on Apple Mac OSX Mojave

A while back, I had to figure out how to install PHP 5.4 on to my newly updated MacBook PRO running OSX (10.14) Mojave. As it turns out, the ability to install PHP 5 dot anything, has been removed from Homebrew. With that being said, I tried to find another method and came across https://php-osx.liip.ch/, […]

Tutorial – How to Recursively Merge Two Objects In PHP

I was recently working on a project and found that I had to merge two very complex objects using PHP. I went to search for a solution and of course found array_merge() and array_merge_recursively(). So naturally, I thought I would start out by converting my objects into arrays and using array_merge_recursively.