<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: comparisons code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 04:33:11 GMT</pubDate>
    <description>DZone Snippets: comparisons code</description>
    <item>
      <title>Reverse switch</title>
      <link>http://snippets.dzone.com/posts/show/2318</link>
      <description>Handy technique if you want to use more complex comparisons other than == in a switch statement.  Much tidier than the elseif equivilant.  &lt;br /&gt;&lt;code&gt;&lt;br /&gt;switch(true) {&lt;br /&gt;&lt;br /&gt;   case $x == "hello":&lt;br /&gt;      // $x is hello&lt;br /&gt;&lt;br /&gt;   case is_numeric($x):&lt;br /&gt;      // $x is a number&lt;br /&gt;&lt;br /&gt;   case $x &lt; 10:&lt;br /&gt;      // $x is less than 10&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 20 Jul 2006 20:22:41 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2318</guid>
      <author>goldfish ()</author>
    </item>
  </channel>
</rss>
