<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fordnox &#187; snippet</title>
	<atom:link href="http://www.fordnox.com/blog/tag/snippet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fordnox.com/blog</link>
	<description>Life is about trust</description>
	<lastBuildDate>Fri, 19 Mar 2010 22:57:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Excel table to PHP array</title>
		<link>http://www.fordnox.com/blog/2008/05/excel-table-to-php-array/</link>
		<comments>http://www.fordnox.com/blog/2008/05/excel-table-to-php-array/#comments</comments>
		<pubDate>Thu, 15 May 2008 15:09:34 +0000</pubDate>
		<dc:creator>Andrius</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php4]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.fordnox.com/blog/?p=69</guid>
		<description><![CDATA[This little function converts string copied from Excel to PHP array. This is useful if you don&#8217;t have posibility to work with PHP5 (or higher).

function parse_excel_string($string, $columnheadings = false, $delimiter = "\t", $enclosure = "\n") {
        $row_index = 0;
        $rows = [...]]]></description>
			<content:encoded><![CDATA[<p>This little function converts string copied from Excel to PHP array. This is useful if you don&#8217;t have posibility to work with PHP5 (or higher).</p>
<pre class="brush: js">
function parse_excel_string($string, $columnheadings = false, $delimiter = "\t", $enclosure = "\n") {
        $row_index = 0;
        $rows = array();
        $array_of_rows = explode($enclosure, rtrim($string));
        if(is_array($array_of_rows) &amp;&amp; !empty($array_of_rows)) {
            if($columnheadings == true) {
                $headings = explode($delimiter, rtrim($array_of_rows[0]));
            }
            foreach ($array_of_rows as $row) {
                $row_values = explode($delimiter, rtrim($row));
                if($headings &amp;&amp; is_array($headings) &amp;&amp; !empty($headings)) {
                    for($i=0;$i&lt;sizeof ($headings);$i++) {
                        $rows[$row_index][$headings[$i]] = $row_values[$i];
                    }
                } else {
                    for($j=0;$j&lt;sizeof($row_values);$j++) {
                        $rows[$row_index][$j] = $row_values[$j];
                    }
                }
                $row_index++;
            }
            if($columnheadings === true) {
                unset($rows[0]);
            }
            $rows = array_values($rows);
            return $rows;
        } else {
            return false;
        }
    }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fordnox.com/blog/2008/05/excel-table-to-php-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
