<?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>emtek.net.nz &#187; PHP</title>
	<atom:link href="http://www.emtek.net.nz/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emtek.net.nz/blog</link>
	<description></description>
	<lastBuildDate>Sun, 11 Apr 2010 03:48:43 +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>PHP &#8211; array_map + create_function</title>
		<link>http://www.emtek.net.nz/blog/2009/09/20/php-array_map-create_function/</link>
		<comments>http://www.emtek.net.nz/blog/2009/09/20/php-array_map-create_function/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 21:59:12 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://emtek.net.nz/blog/?p=77</guid>
		<description><![CDATA[For use with php < 5.3.  If you're using 5.3 just use a proper anonymous function.
array_map(create_function(&#8216;$v&#8217;, &#8216;return strtolower($v).&#8221;s&#8221;;&#8217;), $a);
]]></description>
			<content:encoded><![CDATA[<p>For use with php < 5.3.  If you're using 5.3 just use a proper anonymous function.</p>
<p><code>array_map(create_function(&#8216;$v&#8217;, &#8216;return strtolower($v).&#8221;s&#8221;;&#8217;), $a);</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/09/20/php-array_map-create_function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netbeans + CakePHP &#8211; syntax highlighting for .ctp files</title>
		<link>http://www.emtek.net.nz/blog/2009/08/06/netbeans-cakephp-syntax-highlighting-for-ctp-files/</link>
		<comments>http://www.emtek.net.nz/blog/2009/08/06/netbeans-cakephp-syntax-highlighting-for-ctp-files/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 03:59:42 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://emtek.net.nz/blog/?p=64</guid>
		<description><![CDATA[Tools -&#62; Options -&#62; Miscellaneous -&#62; Files
New File Extension (ctp)
Associate with PHP
Viola! CTP files are now treated as PHP files!
]]></description>
			<content:encoded><![CDATA[<p>Tools -&gt; Options -&gt; Miscellaneous -&gt; Files</p>
<p>New File Extension (ctp)</p>
<p>Associate with PHP</p>
<p>Viola! CTP files are now treated as PHP files!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/08/06/netbeans-cakephp-syntax-highlighting-for-ctp-files/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Split with delimiter caputre</title>
		<link>http://www.emtek.net.nz/blog/2009/07/23/php-split-with-delimiter-caputre/</link>
		<comments>http://www.emtek.net.nz/blog/2009/07/23/php-split-with-delimiter-caputre/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 12:35:40 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://emtek.net.nz/blog/?p=59</guid>
		<description><![CDATA[Split a string on a regular expression and also capture the delimiter.  This can be useful if you have regular expressions like /(cat&#124;dog&#124;fish)/.
$arr = preg_split($rx, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
for ($i = 0; $i &#60; count($arr); $i+=2) {
  $chunk = $arr[0];
  $delim = $arr[1];
}
]]></description>
			<content:encoded><![CDATA[<p>Split a string on a regular expression and also capture the delimiter.  This can be useful if you have regular expressions like /(cat|dog|fish)/.</p>
<pre>$arr = preg_split($rx, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
for ($i = 0; $i &lt; count($arr); $i+=2) {
  $chunk = $arr[0];
  $delim = $arr[1];
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/07/23/php-split-with-delimiter-caputre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dreamweaver mx2004 code color CakePHP template files &#8211; .thtml .ctp</title>
		<link>http://www.emtek.net.nz/blog/2008/06/29/dreamweaver-mx2004-code-color-cakephp-template-files-thtml-ctp/</link>
		<comments>http://www.emtek.net.nz/blog/2008/06/29/dreamweaver-mx2004-code-color-cakephp-template-files-thtml-ctp/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 09:21:39 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://emtek.net.nz/wordpress/?p=5</guid>
		<description><![CDATA[You want to get dreamweaver to treat  .thtml and .ctp files like php files.  There are 2 config files that you&#8217;ll need to edit
View hidden file types
C:\Documents and Settings\[user]\Application Data\Macromedia\Dreamweaver MX 2004\Configuration\Extensions.txt
PHP,PHP3,PHP4,TPL,THTML,CTP:PHP Files

C:\Program Files\Macromedia\Dreamweaver MX 2004\Configuration\DocumentTypes\MMDocumentTypes.xml
&#60;documenttype id=&#8221;PHP_MySQL&#8221; servermodel=&#8221;PHP MySQL&#8221; internaltype=&#8221;Dynamic&#8221; winfileextension=&#8221;php,php3,php4,thtml,ctp&#8221; macfileextension=&#8221;php,php3,php4,thtml,ctp&#8221; file=&#8221;Default.php&#8221; writebyteordermark=&#8221;false&#8221;&#62;
]]></description>
			<content:encoded><![CDATA[<p align="left">You want to get dreamweaver to treat  .thtml and .ctp files like php files.  There are 2 config files that you&#8217;ll need to edit</p>
<p align="left">View hidden file types</p>
<p align="left">C:\Documents and Settings\[user]\Application Data\Macromedia\Dreamweaver MX 2004\Configuration\Extensions.txt</p>
<p align="left">PHP,PHP3,PHP4,TPL,THTML,CTP:PHP Files</p>
<p align="left">
<p align="left">C:\Program Files\Macromedia\Dreamweaver MX 2004\Configuration\DocumentTypes\MMDocumentTypes.xml</p>
<p align="left">&lt;documenttype id=&#8221;PHP_MySQL&#8221; servermodel=&#8221;PHP MySQL&#8221; internaltype=&#8221;Dynamic&#8221; winfileextension=&#8221;php,php3,php4,thtml,ctp&#8221; macfileextension=&#8221;php,php3,php4,thtml,ctp&#8221; file=&#8221;Default.php&#8221; writebyteordermark=&#8221;false&#8221;&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2008/06/29/dreamweaver-mx2004-code-color-cakephp-template-files-thtml-ctp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Duplicating a database using PHP and mysqldump</title>
		<link>http://www.emtek.net.nz/blog/2008/06/29/duplicating-a-database-using-php-mysqldump/</link>
		<comments>http://www.emtek.net.nz/blog/2008/06/29/duplicating-a-database-using-php-mysqldump/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 09:15:42 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://emtek.net.nz/wordpress/?p=4</guid>
		<description><![CDATA[Note i&#8217;m using VPS so there are no restrictions &#8211; you will only be able to do this on some shared hosts.
&#60;?php
error_reporting(E_ALL);
include &#8216;../config/database.php&#8217;;
include &#8216;../vendors/MySQLConnection.php&#8217;; // personal wrapper, should be obvious what it&#8217;s doing
$config = new DATABASE_CONFIG();
$db_test = new MySQLConnection(
$config-&#62;test['host'],
$config-&#62;test['login'],
$config-&#62;test['password'],
$config-&#62;test['database']
);
ob_start();
system(&#8216;mysqldump -h &#8216;.$config-&#62;default['host'].&#8217; -u &#8216;.$config-&#62;default['login'].&#8217; -p&#8217;.$config-&#62;default['password'].&#8217; &#0045;&#0045;compact &#0045;&#0045;add-drop-table &#8216;.$config-&#62;default['database']);
$s = ob_get_clean();
$a = split(&#8216;;&#8217;,$s);
function t(&#38;$s){$s=trim($s);}
array_walk($a,&#8217;t');
foreach ($a as $sql) [...]]]></description>
			<content:encoded><![CDATA[<p>Note i&#8217;m using VPS so there are no restrictions &#8211; you will only be able to do this on some shared hosts.</p>
<p>&lt;?php</p>
<p>error_reporting(E_ALL);<br />
include &#8216;../config/database.php&#8217;;<br />
include &#8216;../vendors/MySQLConnection.php&#8217;; // personal wrapper, should be obvious what it&#8217;s doing<br />
$config = new DATABASE_CONFIG();<br />
$db_test = new MySQLConnection(<br />
$config-&gt;test['host'],<br />
$config-&gt;test['login'],<br />
$config-&gt;test['password'],<br />
$config-&gt;test['database']<br />
);</p>
<p>ob_start();<br />
system(&#8216;mysqldump -h &#8216;.$config-&gt;default['host'].&#8217; -u &#8216;.$config-&gt;default['login'].&#8217; -p&#8217;.$config-&gt;default['password'].&#8217; &#0045;&#0045;compact &#0045;&#0045;add-drop-table &#8216;.$config-&gt;default['database']);<br />
$s = ob_get_clean();<br />
$a = split(&#8216;;&#8217;,$s);<br />
function t(&amp;$s){$s=trim($s);}<br />
array_walk($a,&#8217;t');<br />
foreach ($a as $sql) {<br />
$db_test-&gt;query($sql);<br />
}</p>
<p>?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2008/06/29/duplicating-a-database-using-php-mysqldump/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
