Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 29, 2015 12:00 pm

The Ternary Operator in PHP

What You'll Be Creating

From The Video

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 like:

Written using a ternary operator, we can write the above comparison as:

This is obviously a much simpler way to write relatively easy to understand conditional statements and something we should consider when writing future code,


Original Link:

Share this article:    Share on Facebook
No Article Link

TutsPlus - Code

Tuts+ is a site aimed at web developers and designers offering tutorials and articles on technologies, skills and techniques to improve how you design and build websites.

More About this Source Visit TutsPlus - Code