<?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>Vim, Cygwin, MySQL &#38; Zsh Tips by zzapper &#187; PHP</title>
	<atom:link href="http://zzapper.co.uk/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://zzapper.co.uk</link>
	<description></description>
	<lastBuildDate>Wed, 18 Jan 2012 23:15:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CakePHP is a Piece of Cake!</title>
		<link>http://zzapper.co.uk/cakephp-is-a-piece-of-cake/</link>
		<comments>http://zzapper.co.uk/cakephp-is-a-piece-of-cake/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 20:28:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tips]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=175</guid>
		<description><![CDATA[I&#8217;ve recently become aware of how behind the times my skills are , in particular if you write PHP you are expected to use a framework . I&#8217;ve chosen CakePHP and have installed it on my local Apache Server with a few permission hiccups. I&#8217;ve then completed the create a blog tutorial and it&#8217;s stunning [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently become aware of how behind the times my skills are , in particular if you write PHP you are expected to use a framework . I&#8217;ve chosen CakePHP and have installed it on my local Apache Server with a few permission hiccups. I&#8217;ve then completed the create a blog tutorial and it&#8217;s stunning how easy it is. It uses the MVC or Model-View-Controller system for development. To quote their documentation it <strong>CakePHP takes the monotony out of web development. We provide you with all the tools you need to get started coding what you really need to get done: the logic specific to your application. Instead of reinventing the wheel every time you sit down to a new project, check out a copy of CakePHP and get started with the real guts of your application</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/cakephp-is-a-piece-of-cake/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Remove Home in the Title of New Coppermine Gallery</title>
		<link>http://zzapper.co.uk/how-to-remove-home-in-the-title-of-new-coppermine-gallery/</link>
		<comments>http://zzapper.co.uk/how-to-remove-home-in-the-title-of-new-coppermine-gallery/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 15:44:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tips]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=171</guid>
		<description><![CDATA[Edit include/themes.inc.php Find the function and modify as follows function theme_page_title($section) { global $CONFIG; $return = strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name']; // original code $return = $CONFIG['gallery_name']; // Section removed return $return; } this change works for cpg1.5.x]]></description>
			<content:encoded><![CDATA[<p>Edit include/themes.inc.php</p>
<p>Find the function and modify as follows</p>
<p><code><br />
function theme_page_title($section)<br />
{<br />
    global $CONFIG;<br />
    $return = strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name']; // original code<br />
    $return = $CONFIG['gallery_name']; // Section removed<br />
    return $return;<br />
}<br />
</code></p>
<p>this change works for cpg1.5.x </p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/how-to-remove-home-in-the-title-of-new-coppermine-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing HTML with preg_match</title>
		<link>http://zzapper.co.uk/parsing-html-with-preg_match/</link>
		<comments>http://zzapper.co.uk/parsing-html-with-preg_match/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 20:46:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tips]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=97</guid>
		<description><![CDATA[preg_match_all(&#8216;#&#60;b>.+?&#60;/b>#i&#8217;, $html, $matches); // ? means non-greedy and is absolutely critical $match[1], $match[2] contain the results Non greedy stops the match gobbling everything between the first bold tag and the very last. I&#8217;ve never quite understood why greedy is the default behavior of RegExp (Regular Expressions) but I guess there&#8217;s a good reason for it. [...]]]></description>
			<content:encoded><![CDATA[<p>preg_match_all(&#8216;#&lt;b>.+?&lt;/b>#i&#8217;, $html, $matches);<br />
// ? means non-greedy and is absolutely critical</p>
<p>$match[1], $match[2] contain the results</p>
<p>Non greedy stops the match gobbling everything between the first bold tag and the very last. I&#8217;ve never quite understood why greedy is the default behavior of RegExp (Regular Expressions) but I guess there&#8217;s a good reason for it.</p>
<p>PHP also has the very useful <a href="http://www.php.net/manual/en/function.strip-tags.php">strip_tags</a> function.</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/parsing-html-with-preg_match/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hereis Document for PHP: Great for Generation of HTML</title>
		<link>http://zzapper.co.uk/hereis-document-for-php-great-for-generation-of-html/</link>
		<comments>http://zzapper.co.uk/hereis-document-for-php-great-for-generation-of-html/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 18:28:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[hereis document]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=47</guid>
		<description><![CDATA[I see so much ugly tangled php/javascript/html/css code which could be tidied up with the PHP Hereis Document]]></description>
			<content:encoded><![CDATA[<p><code>The great thing about hereis documents is that in most cases you don't have to backslash quotes, your "html" thus retains its visibility<br />
echo &lt;&lt;&lt;__HTML__</code><br />
&lt;li&gt;&lt;a href=&#8221;$pressdir$file&#8221;&gt;$file&lt;/a&gt;<br />
__HTML__;</p>
<p>$html.= &lt;&lt;&lt;__HTML__<br />
&lt;li&gt;&lt;a href=&#8221;$pressdir$file&#8221;&gt;$file&lt;/a&gt;<br />
__HTML__;</p>
<p>return &lt;&lt;&lt;__HTML__<br />
&lt;li&gt;&lt;a href=&#8221;$pressdir$file&#8221;&gt;$file&lt;/a&gt;<br />
__HTML__;</p>
<p>it can also cope with arrays if you use the following syntax ${my_array['postcode']}</p>
<p>return &lt;&lt;&lt;__HTML__<br />
&lt;li&gt;&lt;a href=&#8221;$multimap_url${my_array['postcode']}&#8221;&gt;${my_array['postcode']}&lt;/a&gt;<br />
__HTML__;</p>
<p>I see so much ugly tangled php/javascript/html/css code which could be tidied up with the PHP Hereis Document</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/hereis-document-for-php-great-for-generation-of-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Design a Database Driven PHP Page</title>
		<link>http://zzapper.co.uk/how-to-design-a-database-driven-php-page/</link>
		<comments>http://zzapper.co.uk/how-to-design-a-database-driven-php-page/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 13:30:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=40</guid>
		<description><![CDATA[Design a Database Driven PHP Page Many PHP pages turn into a mess because the PHP code is embedded into the HTML and. Over time this gets more and more tangled as the requirements change. What is required is to make all the necessary database queries and all the manipulation of the data BEFORE you [...]]]></description>
			<content:encoded><![CDATA[<p>Design a Database Driven PHP Page</p>
<p>Many PHP pages turn into a mess because the PHP code is embedded into the HTML and. Over time this gets more and more tangled as the requirements change.</p>
<p>What is required is to make all the necessary database queries and all the manipulation of the data BEFORE you reach the first  tag.</p>
<p>All that should appear in the HTML are the various php echos to output the dynamic parts of the page.</p>
<p>So here is the structure of a PHP page<br />
<table border=1>
<tr>
<td width=90%>
query database
</td>
</tr>
<tr>
<td width=90%>
insert data from queries into php arrays (hashs)
</td>
</tr>
<tr>
<td width=90%>
General functions
</td>
</tr>
<tr>
<td width=90%>
Main section call functions, which manipulate the data to get that required by the dynamic web page
</td>
</tr>
<tr>
<td width=90%>
html section
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/how-to-design-a-database-driven-php-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

