<?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>Random Things &#187; php</title>
	<atom:link href="http://www.edna.narrabilis.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.edna.narrabilis.com</link>
	<description></description>
	<lastBuildDate>Sat, 18 Jul 2009 15:07:36 +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>Installing Apache and PHP on Windows</title>
		<link>http://www.edna.narrabilis.com/2006/03/22/installing-apache-and-php-on-windows/</link>
		<comments>http://www.edna.narrabilis.com/2006/03/22/installing-apache-and-php-on-windows/#comments</comments>
		<pubDate>Wed, 22 Mar 2006 15:26:21 +0000</pubDate>
		<dc:creator>ednawig</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edna.narrabilis.com/2006/03/22/installing-apache-and-php-on-windows/</guid>
		<description><![CDATA[Yesterday was the first time I installed apache and php on windows! The apache 2 installer worked out of the box, but I had 2 annoyances with php. 


I decided to do the manual install, as recommended. Following all the steps was easy, but to get it to work, I had to make the following [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday was the first time I installed apache and php on windows! The apache 2 installer worked out of the box, but I had 2 annoyances with php. <span id="more-44"></span></p>
<p><span style="float:left; margin-right: 2em; margin-top: 1em; margin-bottom: 1em;"><script type="text/javascript"><!--
google_ad_client = "pub-8771063603940634";
google_ad_width = 125;
google_ad_height = 125;
google_ad_format = "125x125_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "CCCCCC";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_url = "666666";
google_color_text = "333333";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></span>I decided to do the manual install, as recommended. Following all the steps was easy, but to get it to work, I had to make the following changes:
<ol>
<li>The <code>LoadModule </code> directive needs to specify the sapi subdirectory, so if the files are in <code>C:\php</code>, the correct directive in <code>httpd.conf</code> should be<br />
<code>LoadModule php4_module &quot;c:/php/sapi/php4apache2.dll&quot;</code></li>
<li>I needed the gd extension, so I uncommented the <code>extension=php_gd2.dll</code> in <code>php.in</code> (a copy of <code>php.ini-recommended</code>), but that was not good enough. I had to modify the <code>extension_dir</code> setting in <code>php.ini</code> to point at the extensions subdirectory, e.g. <code>extension_dir = &quot;c:/php/extensions&quot;</code>. After restarting apache everything worked as expected.<br />
]]></content:encoded>
			<wfw:commentRss>http://www.edna.narrabilis.com/2006/03/22/installing-apache-and-php-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spreadsheet_Excel_Writer</title>
		<link>http://www.edna.narrabilis.com/2006/03/08/spreadsheet_excel_writer/</link>
		<comments>http://www.edna.narrabilis.com/2006/03/08/spreadsheet_excel_writer/#comments</comments>
		<pubDate>Wed, 08 Mar 2006 16:48:55 +0000</pubDate>
		<dc:creator>ednawig</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edna.narrabilis.com/2006/03/08/spreadsheet_excel_writer/</guid>
		<description><![CDATA[The pear package Spreadsheet_Excel_Writer rocks. I include a file similar to excel.inc file in my scripts, and then send data as needed to the spreadshhet. 
Assume the data is organized in an array $data like this:
$data = array(0=&#62;array(&#34;f0&#34;=&#62;&#34;v00&#34;, &#34;f1&#34;=&#62;&#34;v01&#34;,&#46;..&#34;fn&#34;=&#62;&#34;v0n&#34;),
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1=&#62;array(&#34;f0&#34;=&#62;&#34;v10&#34;, &#34;f1&#34;=&#62;&#34;v11&#34;,&#46;..&#34;fn&#34;=&#62;&#34;v1n&#34;),
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#46;....
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;n=&#62;array(&#34;f0&#34;=&#62;&#34;vn0&#34;, &#34;f1&#34;=&#62;&#34;vn1&#34;,&#46;..&#34;fn&#34;=&#62;&#34;vnn&#34;)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; );

and we are interested in the fields f0, f1, f2 only. The [...]]]></description>
			<content:encoded><![CDATA[<p>The pear package <a href="http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.php">Spreadsheet_Excel_Writer</a> rocks. I include a file similar to <a href="http://www.edna.narrabilis.com/wp-content/uploads/2006/03/excel.html">excel.inc</a> file in my scripts, and then send data as needed to the spreadshhet. <span id="more-35"></span></p>
<p>Assume the data is organized in an array <code>$data</code> like this:<br />
<code>$data = array(0=&gt;array(&quot;f0&quot;=&gt;&quot;v00&quot;, &quot;f1&quot;=&gt;&quot;v01&quot;,&#46;..&quot;fn&quot;=&gt;&quot;v0n&quot;),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1=&gt;array(&quot;f0&quot;=&gt;&quot;v10&quot;, &quot;f1&quot;=&gt;&quot;v11&quot;,&#46;..&quot;fn&quot;=&gt;&quot;v1n&quot;),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#46;....<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n=&gt;array(&quot;f0&quot;=&gt;&quot;vn0&quot;, &quot;f1&quot;=&gt;&quot;vn1&quot;,&#46;..&quot;fn&quot;=&gt;&quot;vnn&quot;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br />
</code></p>
<p>and we are interested in the fields <code>f0, f1, f2</code> only. The headers for these fields should be &#8220;Field One&#8221;, &#8220;Field Two&#8221;, &#8220;Field Three&#8221;. This is easily achieved by this snippet:<br />
<span style="float:left; margin-right: 2em; margin-top: 1em; margin-bottom: 1em;"><br />
<script type="text/javascript"><!--
google_ad_client = "pub-8771063603940634";
google_ad_width = 125;
google_ad_height = 125;
google_ad_format = "125x125_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "CCCCCC";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_url = "666666";
google_color_text = "333333";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
</span><br />
<code><br />
&nbsp;&nbsp; simple_header(array(&quot;Field One&quot;, &quot;Field Two&quot;, &quot;Field Three&quot;));<br />
&nbsp;&nbsp; $lookat = array(&quot;f0&quot;,&quot;f1&quot;,&quot;f2&quot;);<br />
&nbsp;&nbsp; for($j=0; $j&lt;count($data); $j++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; simple_row($data, $lookat, $j+1);<br />
&nbsp;&nbsp; }<br />
</code></p>
<p>And don&#8217;t forget a <code>$xls-&gt;close();</code> after all the data has been output!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edna.narrabilis.com/2006/03/08/spreadsheet_excel_writer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>colorized code in posts</title>
		<link>http://www.edna.narrabilis.com/2006/03/03/colorized-code-in-posts/</link>
		<comments>http://www.edna.narrabilis.com/2006/03/03/colorized-code-in-posts/#comments</comments>
		<pubDate>Fri, 03 Mar 2006 21:08:38 +0000</pubDate>
		<dc:creator>ednawig</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edna.narrabilis.com/2006/03/03/colorized-code-in-posts/</guid>
		<description><![CDATA[This seems to work: (from the command line. php cli needs to be installed)

&#160;&#160; echo &#34;&#60;?php echo highlight_file(&#039;file.php&#039;); ?&#62;&#34; &#124; php -q &#62; file.html

Upload the resulting file and link it to the post as appropriate.
]]></description>
			<content:encoded><![CDATA[<p>This seems to work: (from the command line. php cli needs to be installed)<br />
<code><br />
&nbsp;&nbsp; echo &quot;&lt;?php echo highlight_file(&#039;file.php&#039;); ?&gt;&quot; | php -q &gt; file.html<br />
</code></p>
<p>Upload the resulting file and link it to the post as appropriate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edna.narrabilis.com/2006/03/03/colorized-code-in-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php and (la)TeX</title>
		<link>http://www.edna.narrabilis.com/2006/03/03/6/</link>
		<comments>http://www.edna.narrabilis.com/2006/03/03/6/#comments</comments>
		<pubDate>Fri, 03 Mar 2006 19:50:46 +0000</pubDate>
		<dc:creator>ednawig</dc:creator>
				<category><![CDATA[latex]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edna.narrabilis.com/2006/03/03/6/</guid>
		<description><![CDATA[I often need to format reports such as phonebooks. It&#8217;s hard to get any better than TeX, so I like to combine them 



Click here to see a (very simplified) example. Note that the directory where the files are created has to be writable by apache (assuming that is the owner of the web server [...]]]></description>
			<content:encoded><![CDATA[<p>I often need to format reports such as phonebooks. It&#8217;s hard to get any better than TeX, so I like to combine them <span id="more-6"></span><br />
<span style="float:left; margin-right: 2em; margin-top: 1em; margin-bottom: 1em;"><br />
<!--adsense#side_button--><br />
</span><br />
Click <a id="p10" href="http://www.edna.narrabilis.com/wp-content/uploads/2006/03/2.html">here</a> to see a (very simplified) example. Note that the directory where the files are created has to be writable by <code>apache</code> (assuming that is the owner of the web server processes). And it really should be outside of the DocumentRoot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edna.narrabilis.com/2006/03/03/6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
