<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Nathancarnes's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 17 May 2008 10:08:33 GMT</pubDate>
    <description>DZone Snippets: Nathancarnes's Code Snippets</description>
    <item>
      <title>PHP Select Form Helper</title>
      <link>http://snippets.dzone.com/posts/show/5035</link>
      <description>// takes an array of values and a value to match, and outputs formatted &lt;option&gt;s with the &lt;option&gt; matching $match selected&lt;br /&gt;// must be manually wrapped in &lt;select&gt;&lt;/select to allow for maximum flexibility&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function selectHelper($values, $match)&lt;br /&gt;{&lt;br /&gt;  $keys = array_keys($values);&lt;br /&gt;  $i = 0;&lt;br /&gt;	&lt;br /&gt;  foreach($values as $option)&lt;br /&gt;  {&lt;br /&gt;    $selected = null;&lt;br /&gt;		&lt;br /&gt;    if($match == $keys[$i])&lt;br /&gt;      $selected = " selected";&lt;br /&gt;			&lt;br /&gt;    echo "	&lt;option value=\"".$keys[$i]."\"$selected&gt;".$option."&lt;/option&gt;\n";&lt;br /&gt;		&lt;br /&gt;    $i++;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//sample usage:&lt;br /&gt;$values = array(&lt;br /&gt;  "lb" =&gt; "Pounds",&lt;br /&gt;  "ea" =&gt; "Each",&lt;br /&gt;  "oz" =&gt; "Ounces");&lt;br /&gt;				&lt;br /&gt;  selectHelper($values, $product-&gt;unit);&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 25 Jan 2008 02:13:40 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5035</guid>
      <author>nathancarnes (Nathan Carnes)</author>
    </item>
    <item>
      <title>Favicon discovery</title>
      <link>http://snippets.dzone.com/posts/show/4027</link>
      <description>&lt;code&gt;&lt;br /&gt;&lt;link rel="shortcut icon" href="favicon.ico" /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 15 May 2007 23:33:05 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4027</guid>
      <author>nathancarnes (Nathan Carnes)</author>
    </item>
    <item>
      <title>Object alternative to iframe for XHTML 1.0 strict</title>
      <link>http://snippets.dzone.com/posts/show/3864</link>
      <description>&lt;code&gt;&lt;br /&gt;&lt;object data="mypage.php" type="text/html"&gt;&lt;/object&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 23 Apr 2007 23:46:06 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3864</guid>
      <author>nathancarnes (Nathan Carnes)</author>
    </item>
    <item>
      <title>RSS/Atom Autodiscovery</title>
      <link>http://snippets.dzone.com/posts/show/3802</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;link rel="alternate" type="application/rss+xml" title="RSS Feed" href="rss.xml" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- or... //--&gt;&lt;br /&gt;&lt;br /&gt;&lt;link rel="alternate" type="application/atom+xml" title="Atom Feed" href="Atom.xml" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 12 Apr 2007 04:33:43 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3802</guid>
      <author>nathancarnes (Nathan Carnes)</author>
    </item>
    <item>
      <title>jQuery onLoad alternative</title>
      <link>http://snippets.dzone.com/posts/show/3663</link>
      <description>// faster jQuery-based document.onLoad alternative&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$(document).ready(function() {&lt;br /&gt;   // put all your jQuery goodness in here.&lt;br /&gt;   });&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 12 Mar 2007 19:05:40 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3663</guid>
      <author>nathancarnes (Nathan Carnes)</author>
    </item>
  </channel>
</rss>
