Moving complex php if statements into ternary statement syntax is not always recommended, but I think it can look quite neat and easily readable.
Ternary statements compress your code and using nested ternary statements sparingly in certain situations makes a mess of nested if statements far easier to scan when converted to a nested ternary.
e.g: […]
Posted on March 30th, 2008 by franktank
Filed under: Tips of the Week | No Comments »
Using the composition pattern to generate, clean, well organised, flexible object orientated PHP code is a popular method with todays web programmers. Below is an example of two possible approaches to store a reference of one object to another - a form of composition.
To inspire some interaction we will give the best comment to […]
Posted on March 10th, 2008 by franktank
Filed under: PHP | No Comments »
Validating language specific characters in user input can be a bit of a pain, especially if you are using regular expressions to filter user submitted data.
Not only that, but testing your methods can also be a pain - firstly you will need some shortcuts for entering UTF-8/Unicode chars into form inputs if you […]
Posted on March 9th, 2008 by franktank
Filed under: PHP | 2 Comments »