<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 19 Jun 2013 13:21:00 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Using the Ternary Operator]]></title>
      <guid>http://www.phpdeveloper.org/news/17068</guid>
      <link>http://www.phpdeveloper.org/news/17068</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing the use of a sometimes overlooked (but very handy) alternate syntax that PHP includes - the <a href="http://phpmaster.com/using-the-ternary-operator/">ternary operator</a>, a short-hand if/else.
</p>
<blockquote>
You're probably already familiar with PHP's if statement. It's very similar to its counterparts in many other programming languages and represents one of the most fundamental concepts in programming. [...] But there's a way to build on this concept and increase your $coolFactor a bit in the process. Allow me to introduce you to the ternary operator, which serves as a shorthand notation for if statements.
</blockquote>
<p>
They introduce the ternary operator's syntax, the ":" and "?" operators and includes a few pieces of code showing its use. Thankfully they also include a warning - don't overuse or abuse it...and especially don't nest them - that just leads to headaches.
</p>]]></description>
      <pubDate>Tue, 01 Nov 2011 09:43:35 -0500</pubDate>
    </item>
  </channel>
</rss>
