<?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>Fri, 24 May 2013 05:50:10 -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>
    <item>
      <title><![CDATA[PHP 10.0 Blog: syntax I miss in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/13095</guid>
      <link>http://www.phpdeveloper.org/news/13095</link>
      <description><![CDATA[<p>
In <a href="http://php100.wordpress.com/2009/08/21/syntax-i-miss-in-php/">this new post</a> to the PHP 10.0 blog <i>Stas</i> mentions some of the other syntax options he's like to see in PHP including:
</p>
<ul>
<li>a()() - When a() returns a callable object (such as a closure) the second set of brackets would call it. 
<li>foo(1,2,,4) - Syntax to skip a parameter in a call, which then will be substituted with the default as defined by the function. 
<li>$a = ["a", "b" => "c"]; - I'd really like to have short array syntax. Yes, I know it was rejected so many times already, but I still like it. 
</ul>
<p>
Be sure to catch some of <a href="http://php100.wordpress.com/2009/08/21/syntax-i-miss-in-php/#comments">the good amount of comments</a> with options from others about <i>Stas'</i> suggestions.
</p>]]></description>
      <pubDate>Mon, 24 Aug 2009 09:40:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[WebReference.com: How To Create Alternating Row Colors in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/8086</guid>
      <link>http://www.phpdeveloper.org/news/8086</link>
      <description><![CDATA[<p>
WebReference.com has a <a href="http://www.webreference.com/programming/php_color/">simple new tutorial</a> today showing how to create alternating table rows in the output for your application.
</p>
<blockquote>
Almost every database driven Web site uses alternating row colors when displaying a list of records, a concept used all over the Internet.  You've seen it used, you like it, and now you want to do it yourself.  But you're not sure how to accomplish it.  Well you've come to the right place.  I'm going to discuss the basic idea behind achieving this and give some concrete examples demonstrating different ways to implement it.
</blockquote>
<p>
Their script loops through the information (numbers in their case) and checks, using the modulus operator to check and see which of the CSS styles it should apply to the div. To give a range of possibility, they also show how to do it with a while loop instead of a for to do a little benchmarking of the methods.
</p>]]></description>
      <pubDate>Wed, 20 Jun 2007 11:12:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[MSBWare.com: Alternating Row Colors]]></title>
      <guid>http://www.phpdeveloper.org/news/7760</guid>
      <link>http://www.phpdeveloper.org/news/7760</link>
      <description><![CDATA[<p>
Sometimes, a simple approach is the best. That's what <i>Michael Berman</i> went with in <a href="http://www.msbware.com/articles/PHP_Alternating_Row_Colors_1.html">this light and easy tutorial</a>. It focuses on the creation of an "alternating rows" script with PHP.
</p>
<blockquote>
This concept is used all over the internet.  Almost every database driven website uses alternating row colors when displaying a list of records.  You've seen it used, you like it, and now you want to do it yourself.  But, you're not sure how to accomplish it.  Well you've come to the right place.  I'm going to discuss the basic idea behind achieving this and give some concrete examples demonstrating different ways to implement it.
</blockquote>
<p>
The <a href="http://www.msbware.com/articles/PHP_Alternating_Row_Colors_1.html">example code</a> show how to alternate between two colors - white and grey - for the background of a series of DIVs. He even includes a series of tests to show which method of switching them out would be faster (while loop, for loop, etc).
</p>]]></description>
      <pubDate>Wed, 02 May 2007 16:13:00 -0500</pubDate>
    </item>
  </channel>
</rss>
