<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for oddvalue | Jim Hollington</title>
	<atom:link href="http://oddvalue.co.uk/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://oddvalue.co.uk/blog</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 15:04:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on PHP Form Builder and Validator Class by workout routines to lose weight</title>
		<link>http://oddvalue.co.uk/blog/2010/03/php-form-builder-and-validator-class/comment-page-1/#comment-689</link>
		<dc:creator>workout routines to lose weight</dc:creator>
		<pubDate>Mon, 06 Feb 2012 15:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=142#comment-689</guid>
		<description>&lt;strong&gt;workout routines to lose weight...&lt;/strong&gt;

[...]PHP Form Builder and Validator Class &#171; oddvalue &#124; Jim Hollington[...]...</description>
		<content:encoded><![CDATA[<p><strong>workout routines to lose weight&#8230;</strong></p>
<p>[...]PHP Form Builder and Validator Class &laquo; oddvalue | Jim Hollington[...]&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP Form Builder and Validator Class by scripts and templates</title>
		<link>http://oddvalue.co.uk/blog/2010/03/php-form-builder-and-validator-class/comment-page-1/#comment-430</link>
		<dc:creator>scripts and templates</dc:creator>
		<pubDate>Sun, 11 Dec 2011 16:49:25 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=142#comment-430</guid>
		<description>&lt;strong&gt;scripts and templates...&lt;/strong&gt;

[...]PHP Form Builder and Validator Class &#171; oddvalue &#124; Jim Hollington[...]...</description>
		<content:encoded><![CDATA[<p><strong>scripts and templates&#8230;</strong></p>
<p>[...]PHP Form Builder and Validator Class &laquo; oddvalue | Jim Hollington[...]&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP Form Builder and Validator Class by watch camelot</title>
		<link>http://oddvalue.co.uk/blog/2010/03/php-form-builder-and-validator-class/comment-page-1/#comment-212</link>
		<dc:creator>watch camelot</dc:creator>
		<pubDate>Fri, 04 Nov 2011 05:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=142#comment-212</guid>
		<description>&lt;strong&gt;watch camelot...&lt;/strong&gt;

[...]PHP Form Builder and Validator Class &#171; oddvalue &#124; Jim Hollington[...]...</description>
		<content:encoded><![CDATA[<p><strong>watch camelot&#8230;</strong></p>
<p>[...]PHP Form Builder and Validator Class &laquo; oddvalue | Jim Hollington[...]&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Export to CSV, PHP class by Rick Hurst</title>
		<link>http://oddvalue.co.uk/blog/2010/03/export-to-csv-php-class/comment-page-1/#comment-112</link>
		<dc:creator>Rick Hurst</dc:creator>
		<pubDate>Mon, 19 Sep 2011 13:44:03 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=169#comment-112</guid>
		<description>Thanks for the CSV class - just what I was looking for! There is a slight bug in save() - currently it sets the filename to the date even if you do provide a filename. I changed :-

if(!is_null($file_name)) $file_name = date(&#039;Y-m-d&#039;);

to

if(is_null($file_name)) $file_name = date(&#039;Y-m-d&#039;);

cheers

Rick</description>
		<content:encoded><![CDATA[<p>Thanks for the CSV class &#8211; just what I was looking for! There is a slight bug in save() &#8211; currently it sets the filename to the date even if you do provide a filename. I changed :-</p>
<p>if(!is_null($file_name)) $file_name = date(&#8216;Y-m-d&#8217;);</p>
<p>to</p>
<p>if(is_null($file_name)) $file_name = date(&#8216;Y-m-d&#8217;);</p>
<p>cheers</p>
<p>Rick</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Export to CSV, PHP class by Mahenina</title>
		<link>http://oddvalue.co.uk/blog/2010/03/export-to-csv-php-class/comment-page-1/#comment-82</link>
		<dc:creator>Mahenina</dc:creator>
		<pubDate>Thu, 24 Feb 2011 13:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=169#comment-82</guid>
		<description>It&#039;s very good and works perfectly!
thanks!</description>
		<content:encoded><![CDATA[<p>It&#8217;s very good and works perfectly!<br />
thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Export to CSV, PHP class by Mike</title>
		<link>http://oddvalue.co.uk/blog/2010/03/export-to-csv-php-class/comment-page-1/#comment-78</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 16 Feb 2011 19:54:07 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=169#comment-78</guid>
		<description>Sorry, add an .&quot;\n&quot; to line 7 of my previous code block.</description>
		<content:encoded><![CDATA[<p>Sorry, add an .&#8221;\n&#8221; to line 7 of my previous code block.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Export to CSV, PHP class by Mike</title>
		<link>http://oddvalue.co.uk/blog/2010/03/export-to-csv-php-class/comment-page-1/#comment-77</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 16 Feb 2011 19:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=169#comment-77</guid>
		<description>I&#039;ve tried this out and I had a few comments. I would recommend not relying on the header field names for the columns for the data because in the event that you want the headers to be different, you&#039;re stuck. The loop that you have appending all of the headers to the $csv var could easily be replaced by a implode function ($csv = implode(&#039;,&#039;, $columns).&quot;\n&quot;;). This also solves the problem where you had a comma at the end of the header row. This same extra comma is present in the data building loops. The double-quote escaping function depends on a comma being present in the field data, which may create problems when quotes are used without any commas. All of this can essentially be broken down into a very small build function:

&lt;code&gt;
public static function build($columns, $data){
	$csv = implode(&#039;,&#039;, $columns).&quot;\n&quot;;
	foreach($data as $row){
		foreach($row as $key =&gt; $cell){
			$row[$key] = &#039;&quot;&#039;.str_replace(&#039;&quot;&#039;, &#039;\&quot;&#039;, $cell).&#039;&quot;&#039;;
		}
		$csv .= implode(&#039;,&#039;,$row);
	}
	return $csv;
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;ve tried this out and I had a few comments. I would recommend not relying on the header field names for the columns for the data because in the event that you want the headers to be different, you&#8217;re stuck. The loop that you have appending all of the headers to the $csv var could easily be replaced by a implode function ($csv = implode(&#8216;,&#8217;, $columns).&#8221;\n&#8221;;). This also solves the problem where you had a comma at the end of the header row. This same extra comma is present in the data building loops. The double-quote escaping function depends on a comma being present in the field data, which may create problems when quotes are used without any commas. All of this can essentially be broken down into a very small build function:</p>
<p><code><br />
public static function build($columns, $data){<br />
	$csv = implode(',', $columns)."\n";<br />
	foreach($data as $row){<br />
		foreach($row as $key =&gt; $cell){<br />
			$row[$key] = '"'.str_replace('"', '\"', $cell).'"';<br />
		}<br />
		$csv .= implode(',',$row);<br />
	}<br />
	return $csv;<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pure CSS 3 Analogue Clock by Web Design Pond</title>
		<link>http://oddvalue.co.uk/blog/2010/02/css3_clock/comment-page-1/#comment-40</link>
		<dc:creator>Web Design Pond</dc:creator>
		<pubDate>Tue, 19 Oct 2010 08:50:40 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=108#comment-40</guid>
		<description>&lt;strong&gt;Pure CSS Experiments...&lt;/strong&gt;

This collection started due to a post on the Web Help Forum, where one of its members shared her creation of a css based keyboard. I have personally only used css for its intended purpose of styling a website and have never really experimented with it ...</description>
		<content:encoded><![CDATA[<p><strong>Pure CSS Experiments&#8230;</strong></p>
<p>This collection started due to a post on the Web Help Forum, where one of its members shared her creation of a css based keyboard. I have personally only used css for its intended purpose of styling a website and have never really experimented with it &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Export to CSV, PHP class by shiju</title>
		<link>http://oddvalue.co.uk/blog/2010/03/export-to-csv-php-class/comment-page-1/#comment-37</link>
		<dc:creator>shiju</dc:creator>
		<pubDate>Mon, 04 Oct 2010 04:24:50 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=169#comment-37</guid>
		<description>How can I export the data in multiple sheets in single csv file</description>
		<content:encoded><![CDATA[<p>How can I export the data in multiple sheets in single csv file</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Export to CSV, PHP class by Jim</title>
		<link>http://oddvalue.co.uk/blog/2010/03/export-to-csv-php-class/comment-page-1/#comment-12</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Wed, 28 Apr 2010 13:31:43 +0000</pubDate>
		<guid isPermaLink="false">http://oddvalue.co.uk/blog/?p=169#comment-12</guid>
		<description>Ah ok. If you use mysql_fetch_row then this would probably be best:

&lt;pre lang=&quot;php&quot;&gt;
/**
 * @param array of column headings
 * @return csv
 **/
public function set_headings($columns)
{
	$csv = &#039;&#039;;
 
	foreach($columns as $heading) 
	{
		$csv .= $heading.&#039;,&#039;; 
	}
	$csv .= &quot;\n&quot;;
}

/**
 * @param single row from db
 * @return csv
 **/
public function insert_row($row)
{
	foreach ($row as $item)
	{
		$csv .= $item.&quot;,&quot;; 
	}
 
	return $csv;
}
&lt;/pre&gt;

That way you can set the headings and then add as many rows as you like one at a time after that.</description>
		<content:encoded><![CDATA[<p>Ah ok. If you use mysql_fetch_row then this would probably be best:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * @param array of column headings
 * @return csv
 **/</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> set_headings<span style="color: #009900;">&#40;</span><span style="color: #000088;">$columns</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$csv</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$columns</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$heading</span><span style="color: #009900;">&#41;</span> 
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$csv</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$heading</span><span style="color: #339933;">.</span><span style="color: #0000ff;">','</span><span style="color: #339933;">;</span> 
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000088;">$csv</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * @param single row from db
 * @return csv
 **/</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> insert_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$csv</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">;</span> 
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$csv</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That way you can set the headings and then add as many rows as you like one at a time after that.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

