<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: quick code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 26 Jul 2008 12:33:28 GMT</pubDate>
    <description>DZone Snippets: quick code</description>
    <item>
      <title>PHP Copyright Updater</title>
      <link>http://snippets.dzone.com/posts/show/3652</link>
      <description>// PHP Copyright Updater&lt;br /&gt;// by Evan Walsh&lt;br /&gt;// NothingConcept.com&lt;br /&gt;&lt;br /&gt;This code will automatically change the copyright on your site as the year changes.  Tested and approved by me.&lt;br /&gt;&lt;br /&gt;Just call this in one of your PHP files by including the file with this code in it:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;//Licensed under the GPL v2&lt;br /&gt;//by Evan Walsh of nothingconcept.com&lt;br /&gt;function copyright($site,$year) {&lt;br /&gt;    $current = date(Y);&lt;br /&gt;    if($year == $current) { $eyear = $year; }&lt;br /&gt;    else { $eyear = "$year - $current"; }&lt;br /&gt;    echo "All content &amp;copy; $eyear $site";&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Example: &lt;?php include('functions.php'); ?&gt;&lt;br /&gt;&lt;br /&gt;Then place &lt;?php copyright("Sitename","2007"); ?&gt; or something similar in the place you want the copyright to display.&lt;br /&gt;&lt;br /&gt;Simple as that.</description>
      <pubDate>Fri, 09 Mar 2007 22:41:51 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3652</guid>
      <author>GreyFox (Evan Walsh)</author>
    </item>
    <item>
      <title>PEAR:HTML_QuickForm</title>
      <link>http://snippets.dzone.com/posts/show/827</link>
      <description>HTML_QuickForm($form_name,$http_method,$rel_path,$target,$HTML_attributes)&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;// use the default method (POST), but change the action URL&lt;br /&gt;$default_form = new HTML_QuickForm('default_form','','/dir/page.php');&lt;br /&gt;&lt;br /&gt;// use the default $rel_path as $_SERVER['PHP_SELF']&lt;br /&gt;$get_form = new HTML_QuickForm('get_form','GET');&lt;br /&gt;&lt;br /&gt;// set form HTML attributes&lt;br /&gt;$css_form = new HTML_QuickForm('css_form','','','','class="cform" id="css_form"');&lt;br /&gt;&lt;br /&gt;// add button with HTML attribute&lt;br /&gt;$css_form-&gt;addElement('button', 'close', 'Close','onClick="test();"');&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 22 Oct 2005 01:55:17 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/827</guid>
      <author>snames (Lucius Agrippa)</author>
    </item>
    <item>
      <title>Trimming data contained in an array</title>
      <link>http://snippets.dzone.com/posts/show/382</link>
      <description>&lt;code&gt;&lt;br /&gt;function file_trim(&amp;$value, $key)&lt;br /&gt;{ &lt;br /&gt;   $value = trim($value);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$file = file('name.txt');&lt;br /&gt;@array_walk($file, 'file_trim');&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 14 Jun 2005 23:40:47 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/382</guid>
      <author>mattisbusy (Matt Kaufman)</author>
    </item>
  </channel>
</rss>
