<?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>FettesPS &#187; PHP</title>
	<atom:link href="http://www.fettesps.com/category/programming/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fettesps.com</link>
	<description>Fettes Programming Solutions</description>
	<lastBuildDate>Fri, 30 Jul 2010 19:20:40 +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>PHP &#8211; Auto Convert URLs to Links in a Block of Text</title>
		<link>http://www.fettesps.com/php-auto-convert-urls-to-links-in-a-block-of-text/</link>
		<comments>http://www.fettesps.com/php-auto-convert-urls-to-links-in-a-block-of-text/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 22:13:43 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[preg_match]]></category>
		<category><![CDATA[preg_replace]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[regular expression]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=269</guid>
		<description><![CDATA[Whether you&#8217;re creating your own custom blog, tweaking a CMS or building a plugin this is one block of code that can come in very handy.  I&#8217;ve used this many times over the years and it has always served me well.  I will admit, I am terrible with regular expressions and found this [...]]]></description>
			<content:encoded><![CDATA[<p>Whether you&#8217;re creating your own custom blog, tweaking a CMS or building a plugin this is one block of code that can come in very handy.  I&#8217;ve used this many times over the years and it has always served me well.  I will admit, I am terrible with regular expressions and found this a while back, so I can take no credit for it. Usually I use something like <a href="http://txt2re.com/" target="_new">txt2re</a> when I a cutomer regular expression.</p>
<pre class="brush: php;">$pattern = &quot;@\b(https?://)?(([0-9a-zA-Z_!~*'().&amp;=+$%-]+:)?[0-9a-zA-Z_!~*'().&amp;=+$%-]+\@)?(([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+\.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z]\.[a-zA-Z]{2,6})(:[0-9]{1,4})?((/[0-9a-zA-Z_!~*'().;?:\@&amp;=+$,%#-]+)*/?)@&quot;;

$text = preg_replace($pattern, '&lt;a href=&quot;\0&quot;&gt;\0&lt;/a&gt;', $text_raw);</pre>
<p>Hopefully someone else finds it useful <img src='http://www.fettesps.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/php-auto-convert-urls-to-links-in-a-block-of-text/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Automatically Submit Your Wordpress Posts to Twitter</title>
		<link>http://www.fettesps.com/automatically-submit-your-wordpress-posts-to-twitter/</link>
		<comments>http://www.fettesps.com/automatically-submit-your-wordpress-posts-to-twitter/#comments</comments>
		<pubDate>Fri, 29 May 2009 21:16:24 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[tweet]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=134</guid>
		<description><![CDATA[
Find yourself constantly twittering about your new blog post to increase your SEO for you blog.  Save yourself some time by downloading and installing WordTwit on your blog.  All you have to do is configure your username and password and activate the plugin.

Update:
Well it seems it wasn&#8217;t quite as simple as I first [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Find yourself constantly twittering about your new blog post to increase your SEO for you blog.  Save yourself some time by downloading and installing <a href="http://www.bravenewcode.com/wordtwit/">WordTwit</a> on your blog.  All you have to do is configure your username and password and activate the plugin.</p>
</div>
<div style="font-weight:bold">Update:</div>
<div>Well it seems it wasn&#8217;t quite as simple as I first thought.  By default WordTwit wants to shrink your URLs by using either TinyURL or it&#8217;s own build in algorithm, which doesnt work.  Since TinyURL doesn&#8217;t help me in terms of SEO I wanted to disable this feature completely.  So in order to do that I first had to load up the options to WordTwit by going to Settings-&gt;WordTwit.  Then scroll down to URL Shortenning and make sure Local is selected from the method drop down box.  Now hit Update Options and then go to Plugins, hit the edit button next to WordTwit and look for the function call &#8220;wordtwit_make_tinyurl.&#8221;  We&#8217;re going to tell it to just return the original URL for the local option.  You&#8217;re function should now look like this:</div>
<pre class="brush: php;">function wordtwit_make_tinyurl( $link, $update = true ) {
if ( strpos( $link, 'http://' ) === false) {
return $link;
}
$settings = wordtwit_get_settings();
if ( $settings['url_type'] == 'tinyurl' ) {
return twit_get_tiny_url( $link );
} else if ( $settings['url_type'] == 'local' ) {
return $link;
#return wordtwit_tinyurl( $link, $update );
}
}
</pre>
<p>Now hit update file and try it out again.  This time it should post the actual URL to your blog entry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/automatically-submit-your-wordpress-posts-to-twitter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Writing An A to Z Loop</title>
		<link>http://www.fettesps.com/php-writing-an-a-to-z-loop/</link>
		<comments>http://www.fettesps.com/php-writing-an-a-to-z-loop/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 05:03:48 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[chr]]></category>
		<category><![CDATA[loop]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/blog/?p=15</guid>
		<description><![CDATA[I was recently developing a PHP scraping script to extract the contents of a couple of websites and I wanted to find a quick way to run through a loop for each letter of the alphabet.  I figured since PHP was so versatile there had to be a quick and easy way, so I did [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently developing a PHP scraping script to extract the contents of a couple of websites and I wanted to find a quick way to run through a loop for each letter of the alphabet.  I figured since PHP was so versatile there had to be a quick and easy way, so I did a bit of thinking and came up with this:</p>
<pre class="brush: php;">for($alpha = 65; $alpha &amp;lt;= 90; $alpha++) {
      echo chr($alpha);
}</pre>
<p>Simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/php-writing-an-a-to-z-loop/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
