I created a LAMP (Linux-Apache-MySQL-PHP) local development environment you can use to develop your web applications. It is a docker environment. Docker allows you to separate your development environment from your host computer. The web server and the database server are not installed on your host computer. They run in isolation inside your docker containers, […]
Dev tips about PHP programming, including some quirks and pitfalls of the language you should be aware of.
This article explains all the ways to sort a PHP array. I start with the base sort function, then I explain the possible variations of that basic function. Then I talk about the natural sort, the user-defined sort and the sort options. Finally I show you some pitfalls you should pay attention to.
How you can merge two PHP arrays: with the array_merge function or the + operator. These two methods can lead to very different results, depending on the the keys of the two arrays, if they are strings or numbers. Understanding the differences is very important to avoid unexpected results. With examples.