<?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>Joseph Scott &#187; html_print_r</title>
	<atom:link href="http://josephscott.org/archives/tag/html_print_r/feed/" rel="self" type="application/rss+xml" />
	<link>http://josephscott.org</link>
	<description></description>
	<lastBuildDate>Mon, 06 Sep 2010 17:44:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<atom:link rel='hub' href='http://josephscott.org/?pushpress=hub'/>
		<item>
		<title>PHP Helpers: html_print_r</title>
		<link>http://josephscott.org/archives/2010/02/php-helpers-html_print_r/</link>
		<comments>http://josephscott.org/archives/2010/02/php-helpers-html_print_r/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 16:33:13 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[html_print_r]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php-helpers]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1837</guid>
		<description><![CDATA[Before I get to the next PHP Helpers function I wanted to mention that I&#8217;ve made the code available as a Google Code Project at http://code.google.com/p/php-helpers/. I added specific licensing terms ( MIT style ) &#8211; http://code.google.com/p/php-helpers/source/browse/trunk/license.txt. There&#8217;s also a &#8230; <a href="http://josephscott.org/archives/2010/02/php-helpers-html_print_r/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Before I get to the next PHP Helpers function I wanted to mention that I&#8217;ve made the code available as a Google Code Project at <a href="http://code.google.com/p/php-helpers/">http://code.google.com/p/php-helpers/</a>.  I added specific licensing terms ( MIT style ) &#8211; <a href="http://code.google.com/p/php-helpers/source/browse/trunk/license.txt">http://code.google.com/p/php-helpers/source/browse/trunk/license.txt</a>.  There&#8217;s also a <a href="http://code.google.com/p/php-helpers/source/browse/trunk/changelog.txt">changelog</a> available to see when functions were added.</p>
<p>With that out of the way here&#8217;s the next PHP Helpers function, <code>html_print_r</code>:</p>
<pre class="brush: php;">
if ( !function_exists( 'html_print_r' ) ) {
    function html_print_r( $data ) {
        $out = &quot;\n&lt;pre class='html-print-r'&quot;;
        $out .= &quot; style='border: 1px solid #ccc; padding: 7px;'&gt;\n&quot;;
        $out .= esc_html( print_r( $data, TRUE ) );
        $out .= &quot;\n&lt;/pre&gt;\n&quot;;

        return $out;
    }
}
</pre>
<p>I added this because I use PHP&#8217;s <a href="http://us.php.net/print_r">print_r</a> in an HTML context quite a bit.  To make the output look reasonable I was always adding PRE tags, which got boring fast.</p>
]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/02/php-helpers-html_print_r/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
