<?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>IT Geek! &#187; office</title>
	<atom:link href="http://itgeek.in/tag/office/feed" rel="self" type="application/rss+xml" />
	<link>http://itgeek.in</link>
	<description>the geek life of a Web Developer and Hobbiest Photographer</description>
	<lastBuildDate>Fri, 13 Aug 2010 15:41:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reading Excel Spreadsheets with PHP</title>
		<link>http://itgeek.in/php/reading-excel-spreadsheets-with-php.html</link>
		<comments>http://itgeek.in/php/reading-excel-spreadsheets-with-php.html#comments</comments>
		<pubDate>Mon, 22 Jun 2009 17:43:41 +0000</pubDate>
		<dc:creator>Charandeep Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[phpexcelreader]]></category>
		<category><![CDATA[spreadsheet]]></category>

		<guid isPermaLink="false">http://itgeek.in/?p=249</guid>
		<description><![CDATA[PHP is yet most powerful language when it comes to deal with different data formats like SQL Results, XML Files etc. To improve the functionality of PHP, we use extensions. There are many extensions/packages which let us to read more different types of data formats. Today, we will be using one of them, i.e. phpexcelreader.
PHPExcelReader [...]]]></description>
			<content:encoded><![CDATA[<p>PHP is yet most powerful language when it comes to deal with different data formats like SQL Results, XML Files etc. To improve the functionality of PHP, we use extensions. There are many extensions/packages which let us to read more different types of data formats. Today, we will be using one of them, i.e. <a href="http://sourceforge.net/projects/phpexcelreader/" target="_blank">phpexcelreader</a>.</p>
<p>PHPExcelReader comes with two files <em>oleread.inc</em> and <em>reader.php</em>. We will need to include <em>reader.php</em> in order to use the package. For the sake of &#8220;simplicity&#8221;, I have made some changes in example file and data. Grab it here:<span id="more-249"></span></p>
<p align="center"><a href="http://itgeek.in/wp-content/uploads/2009/06/phpexcelreader.zip">Dowload PHPExcelReader.zip</a></p>
<p align="center">Sample Excel Spreadsheet<br/>

			    <a href="http://itgeek.in/wp-content/uploads/2009/06/excel1.jpg" class="highslide"  onclick="return hs.expand(this, {captionId: 'caption-for-P2490'})"> 
                <img src="http://itgeek.in/wp-content/uploads/2009/06/excel1-300x218.jpg" alt="Sample Excel Spreadsheet" border="0" id="P2490" title="Sample Excel Spreadsheet" /></a> 
								<div class='highslide-caption' id='caption-for-P2490'>
			       		
	     				    	<a href="#" onclick="hs.close(this)" class="highslide-close">Close</a>   	
				<div style="clear:both">Sample Excel Spreadsheet</div>
	
			    </div>

</p>
<p>Take a look at <em>example.php</em>, code is pretty much straight forward. As I said before, in order to use the package we need to include <em>reader.php</em> into our code.<br />
<code>require_once('excel/reader.php');</code><br />
Next, create a new object from the class <em>Spreadsheet_Excel_Reader</em> and give the excel file which you like to read.<br />
<code><br />
$xls = new Spreadsheet_Excel_Reader();<br />
$xls->read('indiastamps_yearsets.xls');<br />
</code><br />
All the rows and columns can be accessed through array variable <em>sheets</em>. We use two <em>for</em> loops to access each and every element of the sheet0.<br />
<code>$xls->sheets[0]['cells'][$row][$column]</code></p>
<p align="center">Result<br/>

			    <a href="http://itgeek.in/wp-content/uploads/2009/06/excel2.jpg" class="highslide"  onclick="return hs.expand(this, {captionId: 'caption-for-P2491'})"> 
                <img src="http://itgeek.in/wp-content/uploads/2009/06/excel2-272x300.jpg" alt="Result" border="0" id="P2491" title="Result" /></a> 
								<div class='highslide-caption' id='caption-for-P2491'>
			       		
	     				    	<a href="#" onclick="hs.close(this)" class="highslide-close">Close</a>   	
				<div style="clear:both">Result</div>
	
			    </div>

</p>
<p>If you are Microsoft Excel 2007 user, be sure about saving file in 1997-2003 .xls format else it will not work. Thanks for reading. <img src='http://itgeek.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://itgeek.in/php/reading-excel-spreadsheets-with-php.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
