Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

NetTuts.com: The Ternary Operator in PHP

NetTuts.com: The Ternary Operator in PHP

If you’re relatively new to the PHP language, there’s an interesting “shorthand” method for evaluation that you may not know about. In this new tutorial from NetTuts.com they show you this handy method – the ternary operator.

The ternary operator allows us to simplify some PHP conditional statements. We’ll see how it can be used, with test-driven development and refactoring, to simplify code.

While the tutorial is largely a screencast, they do provide a quick summary of what the operator is mainly used for and an example for quick reference.

Link: http://code.tutsplus.com/tutorials/the-ternary-operator-in-php–cms-24010
Source: http://www.phpdeveloper.org/news/22767

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Posted Maj 31st, 2015 in WEB and PHP Development.

Leave a response: