Keep Your Website’s Copyright Notice Up-to-Date with PHP
A quick and easy way to keep your websites copyright notice always up to date.
A quick and easy way to keep your websites copyright notice always up to date.
One of the cool and overlooked features of PHP is the presence of “magic constants”. These predefined constants provide helpful information about the current environment or context in which a script runs. Here are the nine magic constants currently available in PHP: These magic constants can be handy in a variety of situations. For example,…
An enum, or enumeration, is a data type that consists of a set of named values. In PHP, enums allow you to create a fixed set of constants representing a specific data type. The primary purpose of enums in PHP is to provide a convenient way to define a set of related constants representing a…
I am not a big fan of the “Try Catch” syntax in PHP, but in some cases, it is necessary. This is a way of capturing exceptions in a section of code and gives you complete control over what to do. The basic syntax is: I find the code gets messy and hard to understand…
Beyond Compare is a legendary piece of software that I have been using for at least ten years. It compares files and folders with an easy-to-use interface and plenty of advanced features. I have used it to manually check code/version changes, organise photos, efficiently transfer files, and much more. For old-school web development, the FTP…
This shorthand syntax is a nice and simple way to increase or decrease an integer variable by 1: And for subtracting: You may know this already, but there is a bit more to these operators when working with strings that you might not be aware of: It gets even more interesting… See more examples in…
PHP has developed into a more strictly typed language in recent years. Type Declarations help with that and are a fairly new addition to PHP, with recent releases improving them further. They give you more precise, concise code, clarity, validation, type-hinting and more. But first… what are Type Declarations? Take a look at this example:…
JavaScript can be a frustrating language. Tame this beast with these tips and tricks.
If you have come to JavaScript from a background in Java or C, you will like the variation on the “for loop“. It is similar to the “for loop” in Perl, Python or PHP but with a little twist. You can use a for loop to repeatedly run a block of code or once for…