<?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>Webmaster Sucks &#187; replace</title>
	<atom:link href="http://www.webmastersucks.com/tags/replace/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webmastersucks.com</link>
	<description>Here I share stuff I used to suck at as a novice webmaster..</description>
	<lastBuildDate>Tue, 11 May 2010 10:56:35 +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>str_replace Case Sensitive Problem</title>
		<link>http://www.webmastersucks.com/str_replace-case-sensitive-problem/</link>
		<comments>http://www.webmastersucks.com/str_replace-case-sensitive-problem/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 09:17:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[case sensitive]]></category>
		<category><![CDATA[ext_str_ireplace]]></category>
		<category><![CDATA[find and replace]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[str_ireplace]]></category>
		<category><![CDATA[str_ireplace php]]></category>
		<category><![CDATA[str_replace]]></category>
		<category><![CDATA[str_replace case sensitive]]></category>
		<category><![CDATA[str_replace php]]></category>

		<guid isPermaLink="false">http://www.webmastersucks.com/?p=231</guid>
		<description><![CDATA[
			
				
			
		
When i use str_replace for replacement in PHP, it is changing without any case sensitive. Example i want to bold HousE, code is
&#60;?
$text = &#34;I like my house.&#34;;
$string = &#34;HousE&#34;;
$text = str_replace($string,&#34;&#60;b&#62;$string&#60;/b&#62;&#34;,$text);
echo($text);
?&#62;

Php 5 have another function to solve this problem str_ireplace() . But this is solve my problem exactly. Because i want to replace case sensitive to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webmastersucks.com%2Fstr_replace-case-sensitive-problem%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webmastersucks.com%2Fstr_replace-case-sensitive-problem%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>When i use str_replace for replacement in PHP, it is changing without any case sensitive. Example i want to bold HousE, code is
<pre class="brush: php;">&lt;?
$text = &quot;I like my house.&quot;;
$string = &quot;HousE&quot;;
$text = str_replace($string,&quot;&lt;b&gt;$string&lt;/b&gt;&quot;,$text);
echo($text);
?&gt;
</pre>
<p>Php 5 have another function to solve this problem <a href="http://tr.php.net/manual/en/function.str-ireplace.php" target="_blank">str_ireplace()</a> . But this is solve my problem exactly. Because i want to replace case sensitive to case sensitive.  I found this solution for my problem. I hope you&#8217;ll enjoy.</p>
<pre class="brush: php;">

function ext_str_ireplace($findme, $replacewith, $subject)
{
     // Replaces $findme in $subject with $replacewith
     // Ignores the case and do keep the original capitalization by using $1 in $replacewith
     // Required: PHP 5

     $rest = $subject;
     $result = '';

     while (stripos($rest, $findme) !== false) {
          $pos = stripos($rest, $findme);

          // Remove the wanted string from $rest and append it to $result
          $result .= substr($rest, 0, $pos);
          $rest = substr($rest, $pos, strlen($rest)-$pos);

          // Remove the wanted string from $rest and place it correctly into $result
          $result .= str_replace('$1', substr($rest, 0, strlen($findme)), $replacewith);
          $rest = substr($rest, strlen($findme), strlen($rest)-strlen($findme));
     }

     // After the last match, append the rest
     $result .= $rest;

     return $result;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.webmastersucks.com/str_replace-case-sensitive-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Converting Unescape Chars in MySQL for SEO</title>
		<link>http://www.webmastersucks.com/converting-unescape-chars-in-mysql-for-seo/</link>
		<comments>http://www.webmastersucks.com/converting-unescape-chars-in-mysql-for-seo/#comments</comments>
		<pubDate>Sat, 30 May 2009 07:40:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[search engine optimization]]></category>

		<guid isPermaLink="false">http://www.webmastersucks.com/?p=12</guid>
		<description><![CDATA[
			
				
			
		
Sometimes, i need to convert datas for search engine optimization (SEO). I use MySQL replace command for this. Just login to phpmyadmin or any tool for run SQL command. Paste command set, change table and field name than run.

UPDATE table SET field = replace(field, 'À','A');
UPDATE table SET field = replace(field, 'Á','A');
UPDATE table SET field = [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webmastersucks.com%2Fconverting-unescape-chars-in-mysql-for-seo%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webmastersucks.com%2Fconverting-unescape-chars-in-mysql-for-seo%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Sometimes, i need to convert datas for search engine optimization (SEO). I use MySQL replace command for this. Just login to phpmyadmin or any tool for run SQL command. Paste command set, change table and field name than run.</p>
<pre class="brush: php;">
UPDATE table SET field = replace(field, 'À','A');
UPDATE table SET field = replace(field, 'Á','A');
UPDATE table SET field = replace(field, 'Â','A');
UPDATE table SET field = replace(field, 'Ã','A');
UPDATE table SET field = replace(field, 'Ä','A');
UPDATE table SET field = replace(field, 'Å','A');
UPDATE table SET field = replace(field, 'Æ','AE');
UPDATE table SET field = replace(field, 'Ç','C');
UPDATE table SET field = replace(field, 'È','E');
UPDATE table SET field = replace(field, 'É','E');
UPDATE table SET field = replace(field, 'Ê','E');
UPDATE table SET field = replace(field, 'Ë','E');
UPDATE table SET field = replace(field, 'Ì','I');
UPDATE table SET field = replace(field, 'Í','I');
UPDATE table SET field = replace(field, 'Î','I');
UPDATE table SET field = replace(field, 'Ï','I');
UPDATE table SET field = replace(field, 'Ò','O');
UPDATE table SET field = replace(field, 'Ó','O');
UPDATE table SET field = replace(field, 'Ô','O');
UPDATE table SET field = replace(field, 'Õ','O');
UPDATE table SET field = replace(field, 'Ö','O');
UPDATE table SET field = replace(field, '×','Z');
UPDATE table SET field = replace(field, 'Ø','O');
UPDATE table SET field = replace(field, 'Ù','U');
UPDATE table SET field = replace(field, 'Ú','U');
UPDATE table SET field = replace(field, 'Û','U');
UPDATE table SET field = replace(field, 'Ü','U');
UPDATE table SET field = replace(field, 'ß','ss');
UPDATE table SET field = replace(field, 'à','a');
UPDATE table SET field = replace(field, 'á','a');
UPDATE table SET field = replace(field, 'â','a');
UPDATE table SET field = replace(field, 'ã','a');
UPDATE table SET field = replace(field, 'ä','a');
UPDATE table SET field = replace(field, 'å','a');
UPDATE table SET field = replace(field, 'æ','ae');
UPDATE table SET field = replace(field, 'ç','c');
UPDATE table SET field = replace(field, 'è','e');
UPDATE table SET field = replace(field, 'é','e');
UPDATE table SET field = replace(field, 'ê','e');
UPDATE table SET field = replace(field, 'ë','e');
UPDATE table SET field = replace(field, 'ì','i');
UPDATE table SET field = replace(field, 'í','i');
UPDATE table SET field = replace(field, 'î','i');
UPDATE table SET field = replace(field, 'ï','i');
UPDATE table SET field = replace(field, 'ñ','n');
UPDATE table SET field = replace(field, 'ü','u');
UPDATE table SET field = replace(field, 'ò','o');
UPDATE table SET field = replace(field, 'ó','o');
UPDATE table SET field = replace(field, 'ô','o');
UPDATE table SET field = replace(field, 'õ','o');
UPDATE table SET field = replace(field, 'ö','o');
UPDATE table SET field = replace(field, 'ø','o');
UPDATE table SET field = replace(field, 'ù','u');
UPDATE table SET field = replace(field, 'ú','u');
UPDATE table SET field = replace(field, 'û','u');
UPDATE table SET field = replace(field, 'ÿ','y');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.webmastersucks.com/converting-unescape-chars-in-mysql-for-seo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
