Every developer uses a set of tools that simplifies their life and without which their development life feels crippled! Over the years, I have developed my own set of tools which I have described in this blog.
Every developer uses a set of tools that simplifies their life and without which their development life feels crippled! Over the years, I have developed my own set of tools which I have described in this blog.
In the previous blog of the series we started with the isset function mistake and I have promised to post about the next mistake which is leaving dangling array references after foreach loop.
While working with arrays, we need foreach to iterate over arrays. In some case, we might be just displaying each array element while iterations but in some case, we might need to manipulate or operate on each element. When there is a case, where we need to operate on each element, using references in foreach loops can be useful. See below code snippet.
While developing a custom frontend for Authors to manage their own content, we needed to let them delete their own items. The Quick & Dirty way of doing this is by executing some delete queries on zoo related tables. But that's not the right & elegant way to do it.
The right way is to use the Zoo API & do this in 3-4 lines of code against 20-30 lines of the dirty code.