<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Preprocessing PHP Includes</title>
	<atom:link href="http://slightlyremarkable.com/blog/2005/05/27/preprocessing-php-includes/feed/" rel="self" type="application/rss+xml" />
	<link>http://slightlyremarkable.com/blog/2005/05/27/preprocessing-php-includes/</link>
	<description>Jonathan Fenocchi's personal weblog</description>
	<lastBuildDate>Sun, 05 Sep 2010 18:15:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jona</title>
		<link>http://slightlyremarkable.com/blog/2005/05/27/preprocessing-php-includes/comment-page-1/#comment-228</link>
		<dc:creator>Jona</dc:creator>
		<pubDate>Thu, 02 Jun 2005 18:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://slightlyremarkable.com/2005/05/preprocessing-php-includes#comment-228</guid>
		<description>Oh, I hadn&#039;t even thought of trying to use the ob-functions. I think I&#039;m going to give it a shot, and see which method is faster -- yours definitely looks more clean! Thanks.</description>
		<content:encoded><![CDATA[<p>Oh, I hadn&#8217;t even thought of trying to use the ob-functions. I think I&#8217;m going to give it a shot, and see which method is faster &#8212; yours definitely looks more clean! Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Child</title>
		<link>http://slightlyremarkable.com/blog/2005/05/27/preprocessing-php-includes/comment-page-1/#comment-225</link>
		<dc:creator>Dave Child</dc:creator>
		<pubDate>Thu, 02 Jun 2005 08:40:05 +0000</pubDate>
		<guid isPermaLink="false">http://slightlyremarkable.com/2005/05/preprocessing-php-includes#comment-225</guid>
		<description>That&#039;s a nice tip. There is another way to do this without using remote files, should the need arise. You can use output buffering - flush the buffer and start a new one before the include, then after the include you can grab the contents of the buffer - which will be the processed include - and assign that to a variable. Empty the buffer and you&#039;ll then have all content before the include sent to the user and the processed include in a variable, which you can then treat like any other normal variable.

&lt;code class=&quot;block&quot;&gt;
ob_start(); // Starts buffer
echo &#039;Hello World&#039;;
ob_flush(); // Flush and empty buffer
include(&#039;foorbar.php&#039;); // Include file
$include = ob_get_clean(); // Ends buffering and assigns contents of buffer (which is now the result of the processed include) to $include
$include = preg_replace(&quot;/\b(and)\b/i&quot;, &#039;$1‘, $include); // And so on ...
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>That&#8217;s a nice tip. There is another way to do this without using remote files, should the need arise. You can use output buffering &#8211; flush the buffer and start a new one before the include, then after the include you can grab the contents of the buffer &#8211; which will be the processed include &#8211; and assign that to a variable. Empty the buffer and you&#8217;ll then have all content before the include sent to the user and the processed include in a variable, which you can then treat like any other normal variable.</p>
<p><code class="block"><br />
ob_start(); // Starts buffer<br />
echo 'Hello World';<br />
ob_flush(); // Flush and empty buffer<br />
include('foorbar.php'); // Include file<br />
$include = ob_get_clean(); // Ends buffering and assigns contents of buffer (which is now the result of the processed include) to $include<br />
$include = preg_replace("/\b(and)\b/i", '$1‘, $include); // And so on ...<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

