<?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: Replace HTML Special Characters With Entities &#8211; But Without Touching Tags</title>
	<atom:link href="http://www.karlrixon.co.uk/articles/php/replace-html-special-characters-with-entities-but-without-touching-tags/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.karlrixon.co.uk/articles/php/replace-html-special-characters-with-entities-but-without-touching-tags/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 29 Jul 2010 23:47:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Karl</title>
		<link>http://www.karlrixon.co.uk/articles/php/replace-html-special-characters-with-entities-but-without-touching-tags/comment-page-1/#comment-398</link>
		<dc:creator>Karl</dc:creator>
		<pubDate>Fri, 13 Nov 2009 23:07:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=94#comment-398</guid>
		<description>Hi Claire

If you just want to do a simple replacement and don&#039;t mind where the word might appear, you would be better off using PHP&#039;s str_replace() function:

[cc lang=&quot;php&quot;]
$word = &quot;foo&quot;;
$replace = &quot;bar&quot;;
$string = &quot;&lt;img src=&quot;hello.png&quot; alt=&quot;This is a nice foo image&quot; /&gt;&lt;p&gt;This is a nice foo string&lt;/p&gt;&quot;;
echo str_replace($word, $replace, $string); // &lt;img src=&quot;hello.png&quot; alt=&quot;This is a nice bar image&quot; /&gt;&lt;p&gt;This is a nice bar string&lt;/p&gt;
[/cc]</description>
		<content:encoded><![CDATA[<p>Hi Claire</p>
<p>If you just want to do a simple replacement and don&#8217;t mind where the word might appear, you would be better off using PHP&#8217;s str_replace() function:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$word</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;foo&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$replace</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;bar&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;img src=&quot;</span>hello<span style="color: #339933;">.</span>png<span style="color: #0000ff;">&quot; alt=&quot;</span>This is a nice foo image<span style="color: #0000ff;">&quot; /&gt;&lt;p&gt;This is a nice foo string&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$word</span><span style="color: #339933;">,</span> <span style="color: #000088;">$replace</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// &lt;img src=&quot;hello.png&quot; alt=&quot;This is a nice bar image&quot; /&gt;&lt;p&gt;This is a nice bar string&lt;/p&gt;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Claire Allen</title>
		<link>http://www.karlrixon.co.uk/articles/php/replace-html-special-characters-with-entities-but-without-touching-tags/comment-page-1/#comment-390</link>
		<dc:creator>Claire Allen</dc:creator>
		<pubDate>Fri, 13 Nov 2009 00:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=94#comment-390</guid>
		<description>sorry... i&#039;m not really sure which parts I need to change to replace a word in the main content of a site, that might also appear in an alt tag?</description>
		<content:encoded><![CDATA[<p>sorry&#8230; i&#8217;m not really sure which parts I need to change to replace a word in the main content of a site, that might also appear in an alt tag?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
