If you’ve ever been to a Disney theme park you’ve probably seen them. People with notebooks busting at the seams with pins, wheeling and dealing with other vacationers as well as Disney cast members. These notebooks are often filled with…
There’s a good chance you’ve seen it before (and possibly authored it), it looks something like this “You have 1 new messages” or “There are 10 user(s) logged in”. What you end up with is something that’s either incorrect or…
Displaying strings isn’t that hard, you just use echo followed by the string in question. But that only gets us so far, what about when we need to use variables inside of the string? Luckily there’s a ton of different…
Nothing spruces up command-line output the way colors do. Just like when you’re customizing your [Bash] prompt, you can use color codes in strings to colorize your output. Keep in mind, these colors will only work on the command-line and…
I’ve been moving towards using longer and longer passwords. When I say longer, I mean upwards of over 20 characters, mixed case, numbers and special characters. These longer passwords make me feel a bit more secure, especially when I can…
Comparing numeric values is a very common programming task. Which number is greater? is lesser? equal? In PHP like any C-style language, you can do these comparisons with a simple if ( … ) { … } statement: if ($var1…
PHP has a variety of functions and approaches to determine if a variable is a number and/or an integer. The problem is that many of the straight forward approaches can result in false positives depending on how they react to…
Whitespace, it can make all the difference in the world when attempting to determine if a string is empty or not. Anytime you are working with user input I recommend stripping whitespace from both sides of the string. When stripping…
Last week I discussed the importance of version control for individuals but something I didn’t touch on was how version control systems can be used to simplify and/or automate deployments. I’ve been through the different setups out there, using plain…
Incrementing and decrementing a variable can be accomplished with C-style pre- and post-operators. The pre-operators return the value after it as been incremented or decremented, post- return the value before. Let’s take a look at incrementing first: $i = 1;…