<?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"
	>
<channel>
	<title>Comments on: Generate Slugs from Strings with PHP</title>
	<atom:link href="http://timjoh.com/generate-slugs-from-strings-with-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://timjoh.com/generate-slugs-from-strings-with-php/</link>
	<description>Code, games, chess and everything but the kitchen sink</description>
	<pubDate>Fri, 21 Nov 2008 12:53:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Gary Cao</title>
		<link>http://timjoh.com/generate-slugs-from-strings-with-php/#comment-95035</link>
		<dc:creator>Gary Cao</dc:creator>
		<pubDate>Mon, 17 Nov 2008 08:38:35 +0000</pubDate>
		<guid isPermaLink="false">http://timjoh.com/generate-slugs-from-strings-with-php/#comment-95035</guid>
		<description>Thanks for the post. I got the same thing working for javascript too:

// Convert a string to a valid identifier
String.prototype.toSlug = function(){
  var slug = this.replace(' ','-').toLowerCase().replace(/[^a-z0-9-]/g,'');
  return slug;
}

Calling toSlug() on a string object will return a valid slug.</description>
		<content:encoded><![CDATA[<p>Thanks for the post. I got the same thing working for javascript too:</p>
<p>// Convert a string to a valid identifier<br />
String.prototype.toSlug = function(){<br />
  var slug = this.replace(&#8217; &#8216;,&#8217;-').toLowerCase().replace(/[^a-z0-9-]/g,&#8221;);<br />
  return slug;<br />
}</p>
<p>Calling toSlug() on a string object will return a valid slug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grant Watson&#8217;s links for 2008-09-24</title>
		<link>http://timjoh.com/generate-slugs-from-strings-with-php/#comment-89044</link>
		<dc:creator>Grant Watson&#8217;s links for 2008-09-24</dc:creator>
		<pubDate>Wed, 24 Sep 2008 22:02:36 +0000</pubDate>
		<guid isPermaLink="false">http://timjoh.com/generate-slugs-from-strings-with-php/#comment-89044</guid>
		<description>[...] Generate Slugs from Strings with PHP &#8212; Timblog If your PHP script is fed a string that you want a similar slug from, you can use this handy one-liner, with $string being the string that you want to slug. (tags: php utils) [...]</description>
		<content:encoded><![CDATA[<p>[...] Generate Slugs from Strings with PHP &#8212; Timblog If your PHP script is fed a string that you want a similar slug from, you can use this handy one-liner, with $string being the string that you want to slug. (tags: php utils) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://timjoh.com/generate-slugs-from-strings-with-php/#comment-16686</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 25 Jun 2007 12:22:44 +0000</pubDate>
		<guid isPermaLink="false">http://timjoh.com/generate-slugs-from-strings-with-php/#comment-16686</guid>
		<description>&lt;b&gt;Joe&lt;/b&gt;: Of course you're right. It's fixed now--thank you.</description>
		<content:encoded><![CDATA[<p><b>Joe</b>: Of course you&#8217;re right. It&#8217;s fixed now&#8211;thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://timjoh.com/generate-slugs-from-strings-with-php/#comment-16620</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 25 Jun 2007 02:10:46 +0000</pubDate>
		<guid isPermaLink="false">http://timjoh.com/generate-slugs-from-strings-with-php/#comment-16620</guid>
		<description>I believe you wanted
$slug = str_replace( ' ', '-', $slug ); // substitute the spaces with hyphens
for line 3, you had a period in the place of a comma.</description>
		<content:encoded><![CDATA[<p>I believe you wanted<br />
$slug = str_replace( &#8216; &#8216;, &#8216;-&#8217;, $slug ); // substitute the spaces with hyphens<br />
for line 3, you had a period in the place of a comma.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
