<?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>edrackham &#187; Tools</title>
	<atom:link href="http://edrackham.com/category/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://edrackham.com</link>
	<description>PHP, MySQL, JavaScript and Other Web Tutorials!</description>
	<lastBuildDate>Thu, 04 Aug 2011 08:30:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>All Beginner Tutorials</title>
		<link>http://edrackham.com/tools/all-beginner-tutorials/</link>
		<comments>http://edrackham.com/tools/all-beginner-tutorials/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 17:45:58 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[All Beginner Tutorials]]></category>

		<guid isPermaLink="false">http://edrackham.com/featured/all-beginner-tutorials/</guid>
		<description><![CDATA[So &#8211; I&#8217;ve just started off this new site &#8211; All Beginner Tutorials. It&#8217;s aimed at becoming a repository for many beginner-focused tutorials. Please take the time to check it out, and even add a tutorial or two!]]></description>
			<content:encoded><![CDATA[<p>So &#8211; I&#8217;ve just started off this new site &#8211; <a href="http://all-beginner-tutorials.com">All Beginner Tutorials</a>. It&#8217;s aimed at becoming a repository for many beginner-focused tutorials. Please take the time to check it out, and even <a href="http://all-beginner-tutorials.com/submit-a-tutorial/">add a tutorial or two</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://edrackham.com/tools/all-beginner-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make URL Safe strings for mod_rewrite using PHP</title>
		<link>http://edrackham.com/php/how-to-make-url-safe-strings-for-mod_rewrite-using-php/</link>
		<comments>http://edrackham.com/php/how-to-make-url-safe-strings-for-mod_rewrite-using-php/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 17:18:18 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Mod_Rewrite]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[mod rewrite]]></category>
		<category><![CDATA[one liner]]></category>
		<category><![CDATA[preg replace]]></category>
		<category><![CDATA[url safe]]></category>

		<guid isPermaLink="false">http://edrackham.com/uncategorized/how-to-make-url-safe-strings-for-mod_rewrite-using-php/</guid>
		<description><![CDATA[It&#8217;s relatively easy to make URL safe strings for use by mod_rewrite. Let&#8217;s use the example that you have a form that adds a new blog post to your site. When the user submits this form, you want to generate a URL safe string (based on the title of the blog post) for mod_rewrite to [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s relatively easy to make URL safe strings for use by mod_rewrite. Let&#8217;s use the example that you have a form that adds a new blog post to your site. When the user submits this form, you want to generate a URL safe string (based on the title of the blog post) for mod_rewrite to use. This little snippet will show you how this can be achieved in one line of code in PHP.<br />
<span id="more-31"></span></p>
<p>The following function shows just how easy it is to generate a URL safe string for mod_rewrite. I&#8217;ve even included a demo of this code below.</p>
<p><div align="center" style="margin-bottom: 20px;">
<script type="text/javascript"><!--
google_ad_client = "pub-4159646232668987";
google_ad_slot = "5003066961";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
<h3>Try it out&#8230;</h3>
<p><iframe frameborder="0" src="http://edrackham.com/tutorials/making-mod-rewrite-strings-with-php/?iframe" height="80px" width="460px" scrolling="no">Your browser doesn&#8217;t support IFRAMES. You can see the URL safe generator <a href="http://edrackham.com/tutorials/making-mod-rewrite-strings-with-php/" title="Simple Online URL Safe Generator">here</a>.</iframe></p>
<pre name="code" class="php">function MakeURLSafeString($string){
    return trim(preg_replace('/[-]{2,}/', '-', preg_replace('/[^a-z0-9]+/', '-', strtolower($_POST['TheString']))), '-');
}</pre>
<p>That&#8217;s all there is to it! To break it down a little, you could have written it as per the following:</p>
<pre name="code" class="php">function MakeURLSafeString($string){
    $string = strtolower($string); // Makes everything lowercase (just looks tidier).
    $string = preg_replace('/[^a-z0-9]+/', '-', $string); // Replaces all non-alphanumeric characters with a hyphen.
    $string = preg_replace('/[-]{2,}/', '-', $string); // Replaces one or more occurrences of a hyphen, with a single one.
    $string = trim($string, '-'); // This ensures that our string doesn't start or end with a hyphen.
    return $string;
}</pre>
<p><div align="center" style="margin-bottom: 20px;">
<script type="text/javascript"><!--
google_ad_client = "pub-4159646232668987";
google_ad_slot = "5003066961";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
]]></content:encoded>
			<wfw:commentRss>http://edrackham.com/php/how-to-make-url-safe-strings-for-mod_rewrite-using-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Functions Inc.</title>
		<link>http://edrackham.com/tools/functions-inc/</link>
		<comments>http://edrackham.com/tools/functions-inc/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 21:12:17 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://edrackham.com/featured/functions-inc/</guid>
		<description><![CDATA[Functions Inc. is a new site I&#8217;ve started for all you guys to add your code snippets to. It&#8217;s an online code snippet repository where you can add your useful snippets, as well as view others. You can keep your snippets private, just using the site as an online code library, or choose to share [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://functionsinc.com">Functions Inc.</a> is a new site I&#8217;ve started for all you guys to add your code snippets to. It&#8217;s an online code snippet repository where you can add your useful snippets, as well as view others. You can keep your snippets private, just using the site as an online code library, or choose to share them with others.</p>
<p>Why not <a href="http://functionsinc.com">head over there now</a> and check it out. It&#8217;s free!</p>
]]></content:encoded>
			<wfw:commentRss>http://edrackham.com/tools/functions-inc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online .htpasswd Generator</title>
		<link>http://edrackham.com/apache/online-htpasswd-generator/</link>
		<comments>http://edrackham.com/apache/online-htpasswd-generator/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 13:51:25 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://edrackham.com/apache/online-htpasswd-generator/</guid>
		<description><![CDATA[Use the following .htpasswd generator to secure your Apache web directories. Your browser does not support IFRAMES. Please view the generator at http://edrackham.com/tutorials/online-htpasswd-generator/ Make sure you have a .htaccess and .htpasswd file in the directory you want to secure, then add the entries once you&#8217;ve generated your password.]]></description>
			<content:encoded><![CDATA[<p>Use the following .htpasswd generator to secure your Apache web directories.</p>
<p><iframe id="htpasswd_generator" name="htpasswd_generator" width="460" scrolling="no" height="130" frameborder="0" src="http://edrackham.com/tutorials/online-htpasswd-generator/?iframe">Your browser does not support IFRAMES. Please view the generator at http://edrackham.com/tutorials/online-htpasswd-generator/</iframe></p>
<p>Make sure you have a .htaccess and .htpasswd file in the directory you want to secure, then add the entries once you&#8217;ve generated your password.</p>
<p><div align="center" style="margin-bottom: 20px;">
<script type="text/javascript"><!--
google_ad_client = "pub-4159646232668987";
google_ad_slot = "5003066961";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
]]></content:encoded>
			<wfw:commentRss>http://edrackham.com/apache/online-htpasswd-generator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Online MD5 Hash Generator</title>
		<link>http://edrackham.com/tools/online-md5-hash-generator/</link>
		<comments>http://edrackham.com/tools/online-md5-hash-generator/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 10:38:41 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://edrackham.com/tools/online-md5-hash-generator/</guid>
		<description><![CDATA[Here is a simple MD5 hash generator I created quickly as part of a useful toolset I&#8217;m planning to build up. Your browser doesn&#8217;t support IFRAMES. You can see the MD5 hash generator here. The code to generate an MD5 hash using PHP is simple: md5($string_to_convert);]]></description>
			<content:encoded><![CDATA[<p>Here is a simple MD5 hash generator I created quickly as part of a useful toolset I&#8217;m planning to build up.</p>
<p><iframe frameborder="0" src="http://edrackham.com/tutorials/online-md5-hash-generator/?iframe" height="80px" width="460px" scrolling="no">Your browser doesn&#8217;t support IFRAMES. You can see the MD5 hash generator <a href="http://edrackham.com/tutorials/online-md5-hash-generator/" title="Simple Online MD5 Hash Generator">here</a>.</iframe></p>
<p>The code to generate an MD5 hash using PHP is simple:</p>
<pre name="code" class="php">md5($string_to_convert);</pre>
<p><div align="center" style="margin-bottom: 20px;">
<script type="text/javascript"><!--
google_ad_client = "pub-4159646232668987";
google_ad_slot = "5003066961";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
]]></content:encoded>
			<wfw:commentRss>http://edrackham.com/tools/online-md5-hash-generator/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

