PHP Shorthand If Notation or the Ternary Operator

Why should I care about PHP Shorthand If Notation or the Ternary Operator

Programming would be a bit useless without being able to evaluate conditions using if/end and switch statements. If/Else statements is obviously a great tool, but they aren’t optimal (or necessary) in all situations. And so I introduce you to … PHP Shorthand If Notation or the Ternary Operator.

Ternary operator takes the form “(condition) ? (true return value) : (false return value)” to shorten your if/else structures.
(more…)

Continue ReadingPHP Shorthand If Notation or the Ternary Operator

jQuery Scroll page to position of an element/div

When you’re working with a complex page that has a load of areas on-screen, making use of this jQuery Scroll page to position of an element/div function below to scroll to the location will enhance you’re user experience by saving them needing to scroll… take them straight to it!

(more…)

Continue ReadingjQuery Scroll page to position of an element/div