<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.marioawad.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Mario Awad</title>
	
	<link>http://www.marioawad.com</link>
	<description>On Software and Web Development</description>
	<lastBuildDate>Fri, 06 Nov 2009 07:32:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.marioawad.com/marioblogfeed" /><feedburner:info uri="marioblogfeed" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>marioblogfeed</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Changing the default Look and Feel of NetBeans</title>
		<link>http://feeds.marioawad.com/~r/marioblogfeed/~3/SoDBBpJh87k/</link>
		<comments>http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 14:27:45 +0000</pubDate>
		<dc:creator>Mario Awad</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://www.marioawad.com/?p=131</guid>
		<description><![CDATA[




		
			Email this to a friend?
		
		
			Send this page to Print Friendly
		
		
			Tweet This!
		
		
			Digg this!
		
		
			Share this on Facebook
		
		
			Share this on del.icio.us
		
		
			Share this on Linkedin
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Reddit
		
		
			Buzz up!
		
		
			Submit this to Script &#38; Style
		
		
			Subscribe to the comments for this post?
		
		
			Post this on Diigo
		
		
			Share this on Technorati
		
		
			Share this on Mixx
		
		
			Post this to MySpace
		
		
			Add [...]]]></description>
			<content:encoded><![CDATA[

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-mail">
			<a href="mailto:?subject=%22Changing%20the%20default%20Look%20and%20Feel%20of%20NetBeans%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Why%20change%20the%20default%20Look%20and%20Feel%3F%0D%0AAesthetics%20apart%2C%20every%20developer%20should%20change%20the%20default%20Look%20and%20Feel%20of%20NetBeans.%20Why%3F%20because%20it%20has%20an%20annoying%20bug.%20Here%27s%20what%20happens%3A%20you%27re%20pumping%20code%20in%20the%20NetBeans%20code%20editor%20like%20crazy.%20You%20need%20to%20switch%20to%20another%20window%20for%20a%20quick%20copy%20%2F%20%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/" rel="nofollow" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="sexy-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/" rel="nofollow" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Changing+the+default+Look+and+Feel+of+NetBeans+-+http://tinyurl.com/ykhqcwo+(via+@marioawad)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;t=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans&amp;summary=Why%20change%20the%20default%20Look%20and%20Feel%3F%0D%0AAesthetics%20apart%2C%20every%20developer%20should%20change%20the%20default%20Look%20and%20Feel%20of%20NetBeans.%20Why%3F%20because%20it%20has%20an%20annoying%20bug.%20Here%27s%20what%20happens%3A%20you%27re%20pumping%20code%20in%20the%20NetBeans%20code%20editor%20like%20crazy.%20You%20need%20to%20switch%20to%20another%20window%20for%20a%20quick%20copy%20%2F%20&amp;source=Mario Awad" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;submitHeadline=Changing+the+default+Look+and+Feel+of+NetBeans&amp;submitSummary=Why%20change%20the%20default%20Look%20and%20Feel%3F%0D%0AAesthetics%20apart%2C%20every%20developer%20should%20change%20the%20default%20Look%20and%20Feel%20of%20NetBeans.%20Why%3F%20because%20it%20has%20an%20annoying%20bug.%20Here%27s%20what%20happens%3A%20you%27re%20pumping%20code%20in%20the%20NetBeans%20code%20editor%20like%20crazy.%20You%20need%20to%20switch%20to%20another%20window%20for%20a%20quick%20copy%20%2F%20&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="sexy-scriptstyle">
			<a href="http://scriptandstyle.com/submit?url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Submit this to Script &amp; Style">Submit this to Script &amp; Style</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans&amp;desc=Why%20change%20the%20default%20Look%20and%20Feel%3F%0D%0AAesthetics%20apart%2C%20every%20developer%20should%20change%20the%20default%20Look%20and%20Feel%20of%20NetBeans.%20Why%3F%20because%20it%20has%20an%20annoying%20bug.%20Here%27s%20what%20happens%3A%20you%27re%20pumping%20code%20in%20the%20NetBeans%20code%20editor%20like%20crazy.%20You%20need%20to%20switch%20to%20another%20window%20for%20a%20quick%20copy%20%2F%20" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;t=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Changing+the+default+Look+and+Feel+of+NetBeans&amp;link=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-wikio">
			<a href="http://www.wikio.com/sharethis?url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Share this on Wikio">Share this on Wikio</a>
		</li>
		<li class="sexy-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/+&quot;Changing+the+default+Look+and+Feel+of+NetBeans&quot;" rel="nofollow" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="sexy-posterous">
			<a href="http://posterous.com/share?linkto=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans&amp;selection=Why%20change%20the%20default%20Look%20and%20Feel%3F%0D%0AAesthetics%20apart%2C%20every%20developer%20should%20change%20the%20default%20Look%20and%20Feel%20of%20NetBeans.%20Why%3F%20because%20it%20has%20an%20annoying%20bug.%20Here%27s%20what%20happens%3A%20you%27re%20pumping%20code%20in%20the%20NetBeans%20code%20editor%20like%20crazy.%20You%20need%20to%20switch%20to%20another%20window%20for%20a%20quick%20copy%20%2F%20" rel="nofollow" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="sexy-pingfm">
			<a href="http://ping.fm/ref/?link=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans&amp;body=Why%20change%20the%20default%20Look%20and%20Feel%3F%0D%0AAesthetics%20apart%2C%20every%20developer%20should%20change%20the%20default%20Look%20and%20Feel%20of%20NetBeans.%20Why%3F%20because%20it%20has%20an%20annoying%20bug.%20Here%27s%20what%20happens%3A%20you%27re%20pumping%20code%20in%20the%20NetBeans%20code%20editor%20like%20crazy.%20You%20need%20to%20switch%20to%20another%20window%20for%20a%20quick%20copy%20%2F%20" rel="nofollow" title="Ping this on Ping.fm">Ping this on Ping.fm</a>
		</li>
		<li class="sexy-netvibes">
			<a href="http://www.netvibes.com/share?title=Changing+the+default+Look+and+Feel+of+NetBeans&amp;url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/" rel="nofollow" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="sexy-blogospherenews">
			<a href="http://www.blogospherenews.com/submit.php?url=http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/&amp;title=Changing+the+default+Look+and+Feel+of+NetBeans" rel="nofollow" title="Share this on Blogosphere News">Share this on Blogosphere News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<h2>Why change the default Look and Feel?</h2>
<p>Aesthetics apart, every developer should change the default Look and Feel of NetBeans. Why? because it has an annoying bug. Here&#8217;s what happens: you&#8217;re pumping code in the NetBeans code editor like crazy. You need to switch to another window for a quick copy / paste from your eternal library of super code. You press ALT + TAB, you go to your other window, you press CTRL + C, you press ALT + TAB, you&#8217;re in NetBeans again getting ready to kick your paste operation using CTRL + V&#8230; but&#8230; but&#8230; you&#8217;re no longer editing the code!!! You&#8217;re now navigating the menu!!! ANNOYING!!! SHOW STOPPER!!!</p>
<p>Luckily, it turns out this is a bug in the Windows Look and Feel of Java (Which NetBeans uses by default). Time to change it of course. Read on.</p>
<p>Note: I&#8217;m running NetBeans IDE 6.7.1 under Windows XP SP3 / Java SDK 1.6. If you have a different version, this bug might not manifest (Lucky you!!!).</p>
<h2>8 Steps to change the default NetBeans Look and Feel</h2>
<ol>
<li>Download the three .nbm files from <a href="http://kenai.com/projects/nbsubstance/downloads/directory/updates">NetBeans substance look and feel plugin</a></li>
<li>Open NetBeans. Go to Tools -&gt; Plugins -&gt; Downloaded</li>
<li>Click on Add Plugins and add the three downloaded .nbm files (You have to add them one by one)</li>
<li>Make sure the three files are selected, click Install, and follow through</li>
<li>Restart NetBeans</li>
<li>Go to Tools -&gt; Options -&gt; Miscellaneous -&gt; Look and Feel</li>
<li>Choose your preferred Look and Feel and Restart NetBeans again</li>
<li>Enjoy <img src='http://www.marioawad.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<h2>References</h2>
<p>ALT + TAB switching to/from netbeans on Windows<br />
<a href="http://forums.netbeans.org/topic5465.html">http://forums.netbeans.org/topic5465.html</a></p>
<p>NetBeans substance look and feel plugin (Project&#8217;s home page)<br />
<a href="http://kenai.com/projects/nbsubstance/pages/Home">http://kenai.com/projects/nbsubstance/pages/Home</a><a href="http://forums.netbeans.org/topic5465.html"></a></p>
<p>NetBeans IDE &#8211; Look and Feel<br />
<a href="http://netbeanside61.blogspot.com/2008/05/netbeans-ide-look-and-feel.html">http://netbeanside61.blogspot.com/2008/05/netbeans-ide-look-and-feel.html</a></p>
<p>JTattoo<br />
<a href="http://www.jtattoo.net">http://www.jtattoo.net</a></p>
<p>20+ Free Look and Feel Libraries for Java Swing<br />
<a href="http://javabyexample.wisdomplug.com/component/content/article/37-core-java/65-20-free-look-and-feel-libraries-for-java-swings.html">http://javabyexample.wisdomplug.com/component/content/article/37-core-java/65-20-free-look-and-feel-libraries-for-java-swings.html</a></p>
<img src="http://feeds.feedburner.com/~r/marioblogfeed/~4/SoDBBpJh87k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.marioawad.com/2009/10/25/changing-the-default-look-and-feel-of-netbeans/</feedburner:origLink></item>
		<item>
		<title>Sending emails with Zend_Mail using Gmail or Google Apps</title>
		<link>http://feeds.marioawad.com/~r/marioblogfeed/~3/pT4LP3pX9TU/</link>
		<comments>http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 17:39:36 +0000</pubDate>
		<dc:creator>Mario Awad</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[google apps]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.marioawad.com/?p=214</guid>
		<description><![CDATA[




		
			Email this to a friend?
		
		
			Send this page to Print Friendly
		
		
			Tweet This!
		
		
			Digg this!
		
		
			Share this on Facebook
		
		
			Share this on del.icio.us
		
		
			Share this on Linkedin
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Reddit
		
		
			Buzz up!
		
		
			Submit this to Script &#38; Style
		
		
			Subscribe to the comments for this post?
		
		
			Post this on Diigo
		
		
			Share this on Technorati
		
		
			Share this on Mixx
		
		
			Post this to MySpace
		
		
			Add [...]]]></description>
			<content:encoded><![CDATA[

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-mail">
			<a href="mailto:?subject=%22Sending%20emails%20with%20Zend_Mail%20using%20Gmail%20or%20Google%20Apps%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Zend%20Framework%20is%20currently%20one%20of%20the%20best%20MVC-based%20frameworks%20in%20the%20PHP%20world.%20Zend_Mail%20is%20part%20of%20Zend%20Framework%20and%20it%20provides%20the%20ability%20to%20easily%20send%20email%20messages.%20If%20you%27re%20like%20me%2C%20most%20web%20applications%20you%20have%20developed%20are%20setup%20to%20use%20Google%20Apps%20as%20their%20email%20provider.%20Here%27s%20h%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/" rel="nofollow" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="sexy-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/" rel="nofollow" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps+-+http://tinyurl.com/yf74gst+(via+@marioawad)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;t=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps&amp;summary=Zend%20Framework%20is%20currently%20one%20of%20the%20best%20MVC-based%20frameworks%20in%20the%20PHP%20world.%20Zend_Mail%20is%20part%20of%20Zend%20Framework%20and%20it%20provides%20the%20ability%20to%20easily%20send%20email%20messages.%20If%20you%27re%20like%20me%2C%20most%20web%20applications%20you%20have%20developed%20are%20setup%20to%20use%20Google%20Apps%20as%20their%20email%20provider.%20Here%27s%20h&amp;source=Mario Awad" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;submitHeadline=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps&amp;submitSummary=Zend%20Framework%20is%20currently%20one%20of%20the%20best%20MVC-based%20frameworks%20in%20the%20PHP%20world.%20Zend_Mail%20is%20part%20of%20Zend%20Framework%20and%20it%20provides%20the%20ability%20to%20easily%20send%20email%20messages.%20If%20you%27re%20like%20me%2C%20most%20web%20applications%20you%20have%20developed%20are%20setup%20to%20use%20Google%20Apps%20as%20their%20email%20provider.%20Here%27s%20h&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="sexy-scriptstyle">
			<a href="http://scriptandstyle.com/submit?url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Submit this to Script &amp; Style">Submit this to Script &amp; Style</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps&amp;desc=Zend%20Framework%20is%20currently%20one%20of%20the%20best%20MVC-based%20frameworks%20in%20the%20PHP%20world.%20Zend_Mail%20is%20part%20of%20Zend%20Framework%20and%20it%20provides%20the%20ability%20to%20easily%20send%20email%20messages.%20If%20you%27re%20like%20me%2C%20most%20web%20applications%20you%20have%20developed%20are%20setup%20to%20use%20Google%20Apps%20as%20their%20email%20provider.%20Here%27s%20h" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;t=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps&amp;link=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-wikio">
			<a href="http://www.wikio.com/sharethis?url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Share this on Wikio">Share this on Wikio</a>
		</li>
		<li class="sexy-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/+&quot;Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps&quot;" rel="nofollow" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="sexy-posterous">
			<a href="http://posterous.com/share?linkto=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps&amp;selection=Zend%20Framework%20is%20currently%20one%20of%20the%20best%20MVC-based%20frameworks%20in%20the%20PHP%20world.%20Zend_Mail%20is%20part%20of%20Zend%20Framework%20and%20it%20provides%20the%20ability%20to%20easily%20send%20email%20messages.%20If%20you%27re%20like%20me%2C%20most%20web%20applications%20you%20have%20developed%20are%20setup%20to%20use%20Google%20Apps%20as%20their%20email%20provider.%20Here%27s%20h" rel="nofollow" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="sexy-pingfm">
			<a href="http://ping.fm/ref/?link=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps&amp;body=Zend%20Framework%20is%20currently%20one%20of%20the%20best%20MVC-based%20frameworks%20in%20the%20PHP%20world.%20Zend_Mail%20is%20part%20of%20Zend%20Framework%20and%20it%20provides%20the%20ability%20to%20easily%20send%20email%20messages.%20If%20you%27re%20like%20me%2C%20most%20web%20applications%20you%20have%20developed%20are%20setup%20to%20use%20Google%20Apps%20as%20their%20email%20provider.%20Here%27s%20h" rel="nofollow" title="Ping this on Ping.fm">Ping this on Ping.fm</a>
		</li>
		<li class="sexy-netvibes">
			<a href="http://www.netvibes.com/share?title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps&amp;url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/" rel="nofollow" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="sexy-blogospherenews">
			<a href="http://www.blogospherenews.com/submit.php?url=http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/&amp;title=Sending+emails+with+Zend_Mail+using+Gmail+or+Google+Apps" rel="nofollow" title="Share this on Blogosphere News">Share this on Blogosphere News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<p><a href="http://framework.zend.com">Zend Framework</a> is currently one of the best MVC-based frameworks in the PHP world. <a href="http://framework.zend.com/manual/en/zend.mail.html">Zend_Mail</a> is part of Zend Framework and it provides the ability to easily send email messages. If you&#8217;re like me, most web applications you have developed are setup to use Google Apps as their email provider. Here&#8217;s how to send email messages via Gmail or Google Apps by using Zend_Mail.</p>
<pre class="brush: php;">
public function send() {

 //Initialize needed variables
 $your_name = 'Mario Awad';
 $your_email = 'your_email@your_domain.com'; //Or your_email@gmail.com for Gmail
 $your_password = 'your_password';
 $send_to_name = 'My Friend';
 $send_to_email = 'myfriend@tempinbox.com';

 //SMTP server configuration
 $smtpHost = 'smtp.gmail.com';
 $smtpConf = array(
  'auth' =&gt; 'login',
  'ssl' =&gt; 'ssl',
  'port' =&gt; '465',
  'username' =&gt; $your_email,
  'password' =&gt; $your_password
 );
 $transport = new Zend_Mail_Transport_Smtp($smtpHost, $smtpConf);

 //Create email
 $mail = new Zend_Mail();
 $mail-&gt;setFrom($your_email, $your_name);
 $mail-&gt;addTo($send_to_email, $send_to_name);
 $mail-&gt;setSubject('Hello World');
 $mail-&gt;setBodyText('This is the body text of the email.');

 //Send
 $sent = true;
 try {
  $mail-&gt;send($transport);
 }
 catch (Exception $e) {
  $sent = false;
 }

 //Return boolean indicating success or failure
 return $sent;

}
</pre>
<p>In addition to the above code, please note the following:</p>
<ul>
<li>You must enable the &#8220;php_openssl&#8221; extension to use the SSL transport protocol (Which is needed for Gmail and Google Apps). All you have to do is open your &#8220;php.ini&#8221; file and uncomment the line that includes the &#8220;php_openssl&#8221; extension (Search for &#8220;php_openssl&#8221; and you&#8217;ll find it).</li>
<li>I found many resources on the web stating that you should use the TLS transport protocol (They never mention how to use or setup the SSL transfer protocol). This didn&#8217;t work in my tests and always resulted in a timeout error.</li>
<li>Yes, you must use &#8220;smtp.gmail.com&#8221; as your SMTP host even if you&#8217;re configuring the application for Google Apps. In other words, don&#8217;t use &#8220;smtp.yourdomain.com&#8221;.</li>
</ul>
<p>I hope this small tutorial saves you some headaches. Cheers <img src='http://www.marioawad.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/marioblogfeed/~4/pT4LP3pX9TU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.marioawad.com/2009/10/17/sending-emails-with-zend_mail-using-gmail-or-google-apps/</feedburner:origLink></item>
		<item>
		<title>Capture the output of var_dump in a string</title>
		<link>http://feeds.marioawad.com/~r/marioblogfeed/~3/S3hHn-P2k0s/</link>
		<comments>http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 11:43:15 +0000</pubDate>
		<dc:creator>Mario Awad</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.marioawad.com/?p=199</guid>
		<description><![CDATA[




		
			Email this to a friend?
		
		
			Send this page to Print Friendly
		
		
			Tweet This!
		
		
			Digg this!
		
		
			Share this on Facebook
		
		
			Share this on del.icio.us
		
		
			Share this on Linkedin
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Reddit
		
		
			Buzz up!
		
		
			Submit this to Script &#38; Style
		
		
			Subscribe to the comments for this post?
		
		
			Post this on Diigo
		
		
			Share this on Technorati
		
		
			Share this on Mixx
		
		
			Post this to MySpace
		
		
			Add [...]]]></description>
			<content:encoded><![CDATA[

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-mail">
			<a href="mailto:?subject=%22Capture%20the%20output%20of%20var_dump%20in%20a%20string%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Introduction%0D%0AYou%20are%20programming%20in%20PHP%20and%20you%20have%20an%20array%20variable%20that%20you%27d%20like%20to%20explore%20at%20different%20execution%20paths.%20Of%20course%2C%20the%20best%20way%20is%20to%20use%20a%20PHP%20debugger%20like%20xdebug%20or%20Zend%20Debugger%2C%20but%2C%20what%20happens%20when%20you%27re%20too%20lazy%20to%20install%20a%20debugger%3F%20What%20happens%20when%20you%20don%27t%20wa%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/" rel="nofollow" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="sexy-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/" rel="nofollow" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Capture+the+output+of+var_dump+in+a+string+-+http://tinyurl.com/yzxx2zt+(via+@marioawad)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;t=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string&amp;summary=Introduction%0D%0AYou%20are%20programming%20in%20PHP%20and%20you%20have%20an%20array%20variable%20that%20you%27d%20like%20to%20explore%20at%20different%20execution%20paths.%20Of%20course%2C%20the%20best%20way%20is%20to%20use%20a%20PHP%20debugger%20like%20xdebug%20or%20Zend%20Debugger%2C%20but%2C%20what%20happens%20when%20you%27re%20too%20lazy%20to%20install%20a%20debugger%3F%20What%20happens%20when%20you%20don%27t%20wa&amp;source=Mario Awad" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;submitHeadline=Capture+the+output+of+var_dump+in+a+string&amp;submitSummary=Introduction%0D%0AYou%20are%20programming%20in%20PHP%20and%20you%20have%20an%20array%20variable%20that%20you%27d%20like%20to%20explore%20at%20different%20execution%20paths.%20Of%20course%2C%20the%20best%20way%20is%20to%20use%20a%20PHP%20debugger%20like%20xdebug%20or%20Zend%20Debugger%2C%20but%2C%20what%20happens%20when%20you%27re%20too%20lazy%20to%20install%20a%20debugger%3F%20What%20happens%20when%20you%20don%27t%20wa&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="sexy-scriptstyle">
			<a href="http://scriptandstyle.com/submit?url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Submit this to Script &amp; Style">Submit this to Script &amp; Style</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string&amp;desc=Introduction%0D%0AYou%20are%20programming%20in%20PHP%20and%20you%20have%20an%20array%20variable%20that%20you%27d%20like%20to%20explore%20at%20different%20execution%20paths.%20Of%20course%2C%20the%20best%20way%20is%20to%20use%20a%20PHP%20debugger%20like%20xdebug%20or%20Zend%20Debugger%2C%20but%2C%20what%20happens%20when%20you%27re%20too%20lazy%20to%20install%20a%20debugger%3F%20What%20happens%20when%20you%20don%27t%20wa" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;t=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Capture+the+output+of+var_dump+in+a+string&amp;link=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-wikio">
			<a href="http://www.wikio.com/sharethis?url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Share this on Wikio">Share this on Wikio</a>
		</li>
		<li class="sexy-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/+&quot;Capture+the+output+of+var_dump+in+a+string&quot;" rel="nofollow" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="sexy-posterous">
			<a href="http://posterous.com/share?linkto=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string&amp;selection=Introduction%0D%0AYou%20are%20programming%20in%20PHP%20and%20you%20have%20an%20array%20variable%20that%20you%27d%20like%20to%20explore%20at%20different%20execution%20paths.%20Of%20course%2C%20the%20best%20way%20is%20to%20use%20a%20PHP%20debugger%20like%20xdebug%20or%20Zend%20Debugger%2C%20but%2C%20what%20happens%20when%20you%27re%20too%20lazy%20to%20install%20a%20debugger%3F%20What%20happens%20when%20you%20don%27t%20wa" rel="nofollow" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="sexy-pingfm">
			<a href="http://ping.fm/ref/?link=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string&amp;body=Introduction%0D%0AYou%20are%20programming%20in%20PHP%20and%20you%20have%20an%20array%20variable%20that%20you%27d%20like%20to%20explore%20at%20different%20execution%20paths.%20Of%20course%2C%20the%20best%20way%20is%20to%20use%20a%20PHP%20debugger%20like%20xdebug%20or%20Zend%20Debugger%2C%20but%2C%20what%20happens%20when%20you%27re%20too%20lazy%20to%20install%20a%20debugger%3F%20What%20happens%20when%20you%20don%27t%20wa" rel="nofollow" title="Ping this on Ping.fm">Ping this on Ping.fm</a>
		</li>
		<li class="sexy-netvibes">
			<a href="http://www.netvibes.com/share?title=Capture+the+output+of+var_dump+in+a+string&amp;url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/" rel="nofollow" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="sexy-blogospherenews">
			<a href="http://www.blogospherenews.com/submit.php?url=http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/&amp;title=Capture+the+output+of+var_dump+in+a+string" rel="nofollow" title="Share this on Blogosphere News">Share this on Blogosphere News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<h2>Introduction</h2>
<p>You are programming in PHP and you have an array variable that you&#8217;d like to explore at different execution paths. Of course, the best way is to use a PHP debugger like <a href="http://xdebug.org">xdebug</a> or <a href="http://www.zend.com/en/community/pdt">Zend Debugger</a>, but, what happens when you&#8217;re too lazy to install a debugger? What happens when you don&#8217;t want or can&#8217;t install a debugger and you just need to check the content of that array by dumping it in your log file? Well, you might think you&#8217;re stuck, but, read on&#8230;</p>
<h2>What is var_dump?</h2>
<p>The <a href="http://www.php.net/var_dump">var_dump manual page</a> states that var_dump displays structured information about one or more expressions that includes its type and value. Arrays and objects are explored recursively with values indented to show structure.</p>
<p>The problem is that var_dump outputs its result directly to the browser, how can you capture its output in a string variable? read on&#8230;</p>
<h2>Using output control functions for the solution</h2>
<p>Output control functions can be used to capture and redirect the standard output. For more details, read the <a href="http://www.php.net/manual/en/ref.outcontrol.php">PHP manual on output control functions</a>, of course.</p>
<p>Here&#8217;s the solution:</p>
<pre class="brush: php;">
function varDumpToString ($var)
{
    ob_start();
    var_dump($var);
    $result = ob_get_clean();
    return $result;
}
//
//Example usage:
//    $data = array('first', 'second', 'third');
//    $result = varDumpToString($data);
//
</pre>
<p>All you have to do now is call the varDumpToString function. Happy coding <img src='http://www.marioawad.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/marioblogfeed/~4/S3hHn-P2k0s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.marioawad.com/2009/07/11/capture-the-output-of-var_dump-in-a-string/</feedburner:origLink></item>
		<item>
		<title>Hide Gmail’s spam count</title>
		<link>http://feeds.marioawad.com/~r/marioblogfeed/~3/m75Syr77xIg/</link>
		<comments>http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 17:34:28 +0000</pubDate>
		<dc:creator>Mario Awad</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.marioawad.com/?p=144</guid>
		<description><![CDATA[




		
			Email this to a friend?
		
		
			Send this page to Print Friendly
		
		
			Tweet This!
		
		
			Digg this!
		
		
			Share this on Facebook
		
		
			Share this on del.icio.us
		
		
			Share this on Linkedin
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Reddit
		
		
			Buzz up!
		
		
			Submit this to Script &#38; Style
		
		
			Subscribe to the comments for this post?
		
		
			Post this on Diigo
		
		
			Share this on Technorati
		
		
			Share this on Mixx
		
		
			Post this to MySpace
		
		
			Add [...]]]></description>
			<content:encoded><![CDATA[

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-mail">
			<a href="mailto:?subject=%22Hide%20Gmail%27s%20spam%20count%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Does%20the%20spam%20count%20in%20Gmail%20bother%20you%3F%20It%20certainly%20does.%0D%0A%0D%0AAre%20you%20too%20lazy%20to%20delete%20your%20spam%20messages%20every%20few%20minutes%3F%20Of%20course%20you%20are.%0D%0A%0D%0AWould%20you%20like%20to%20preserve%20your%20spam%20messages%20just%20in%20case%20they%20might%20contain%20a%20legitimate%20email%3F%20Of%20course%20you%20would%20love%20to.%0D%0A%0D%0AYou%20hate%20using%20third%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/" rel="nofollow" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="sexy-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/" rel="nofollow" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Hide+Gmail%27s+spam+count+-+http://tinyurl.com/yfmztrk+(via+@marioawad)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;t=Hide+Gmail%27s+spam+count" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count&amp;summary=Does%20the%20spam%20count%20in%20Gmail%20bother%20you%3F%20It%20certainly%20does.%0D%0A%0D%0AAre%20you%20too%20lazy%20to%20delete%20your%20spam%20messages%20every%20few%20minutes%3F%20Of%20course%20you%20are.%0D%0A%0D%0AWould%20you%20like%20to%20preserve%20your%20spam%20messages%20just%20in%20case%20they%20might%20contain%20a%20legitimate%20email%3F%20Of%20course%20you%20would%20love%20to.%0D%0A%0D%0AYou%20hate%20using%20third&amp;source=Mario Awad" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;submitHeadline=Hide+Gmail%27s+spam+count&amp;submitSummary=Does%20the%20spam%20count%20in%20Gmail%20bother%20you%3F%20It%20certainly%20does.%0D%0A%0D%0AAre%20you%20too%20lazy%20to%20delete%20your%20spam%20messages%20every%20few%20minutes%3F%20Of%20course%20you%20are.%0D%0A%0D%0AWould%20you%20like%20to%20preserve%20your%20spam%20messages%20just%20in%20case%20they%20might%20contain%20a%20legitimate%20email%3F%20Of%20course%20you%20would%20love%20to.%0D%0A%0D%0AYou%20hate%20using%20third&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="sexy-scriptstyle">
			<a href="http://scriptandstyle.com/submit?url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count" rel="nofollow" title="Submit this to Script &amp; Style">Submit this to Script &amp; Style</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count&amp;desc=Does%20the%20spam%20count%20in%20Gmail%20bother%20you%3F%20It%20certainly%20does.%0D%0A%0D%0AAre%20you%20too%20lazy%20to%20delete%20your%20spam%20messages%20every%20few%20minutes%3F%20Of%20course%20you%20are.%0D%0A%0D%0AWould%20you%20like%20to%20preserve%20your%20spam%20messages%20just%20in%20case%20they%20might%20contain%20a%20legitimate%20email%3F%20Of%20course%20you%20would%20love%20to.%0D%0A%0D%0AYou%20hate%20using%20third" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;t=Hide+Gmail%27s+spam+count" rel="nofollow" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count" rel="nofollow" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Hide+Gmail%27s+spam+count&amp;link=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-wikio">
			<a href="http://www.wikio.com/sharethis?url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count" rel="nofollow" title="Share this on Wikio">Share this on Wikio</a>
		</li>
		<li class="sexy-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/+&quot;Hide+Gmail%27s+spam+count&quot;" rel="nofollow" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="sexy-posterous">
			<a href="http://posterous.com/share?linkto=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count&amp;selection=Does%20the%20spam%20count%20in%20Gmail%20bother%20you%3F%20It%20certainly%20does.%0D%0A%0D%0AAre%20you%20too%20lazy%20to%20delete%20your%20spam%20messages%20every%20few%20minutes%3F%20Of%20course%20you%20are.%0D%0A%0D%0AWould%20you%20like%20to%20preserve%20your%20spam%20messages%20just%20in%20case%20they%20might%20contain%20a%20legitimate%20email%3F%20Of%20course%20you%20would%20love%20to.%0D%0A%0D%0AYou%20hate%20using%20third" rel="nofollow" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="sexy-pingfm">
			<a href="http://ping.fm/ref/?link=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count&amp;body=Does%20the%20spam%20count%20in%20Gmail%20bother%20you%3F%20It%20certainly%20does.%0D%0A%0D%0AAre%20you%20too%20lazy%20to%20delete%20your%20spam%20messages%20every%20few%20minutes%3F%20Of%20course%20you%20are.%0D%0A%0D%0AWould%20you%20like%20to%20preserve%20your%20spam%20messages%20just%20in%20case%20they%20might%20contain%20a%20legitimate%20email%3F%20Of%20course%20you%20would%20love%20to.%0D%0A%0D%0AYou%20hate%20using%20third" rel="nofollow" title="Ping this on Ping.fm">Ping this on Ping.fm</a>
		</li>
		<li class="sexy-netvibes">
			<a href="http://www.netvibes.com/share?title=Hide+Gmail%27s+spam+count&amp;url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/" rel="nofollow" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="sexy-blogospherenews">
			<a href="http://www.blogospherenews.com/submit.php?url=http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/&amp;title=Hide+Gmail%27s+spam+count" rel="nofollow" title="Share this on Blogosphere News">Share this on Blogosphere News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<p>Does the spam count in Gmail bother you? It certainly does.</p>
<p>Are you too lazy to delete your spam messages every few minutes? Of course you are.</p>
<p>Would you like to preserve your spam messages just in case they might contain a legitimate email? Of course you would love to.</p>
<p>You hate using third party tools such as <a href="https://addons.mozilla.org/en-US/firefox/addon/748">Greasemonkey</a> scripts to accomplish this very simple task? Of course you do.</p>
<p>Well, you&#8217;re in luck. I found this <a href="http://lifehacker.com/software/gmail/get-rid-of-gmails-unread-spam-count-323944.php">quick tip at Lifehacker</a> and thought it&#8217;s too good not to be shared. The idea is to create a filter telling Gmail that all incoming spam messages should be marked as read. Of course, Gmail will keep spam messages for 30 days, giving you enough time to rescue legitimate email when you get that angry call from a customer or friend (Ummm&#8230; euhh&#8230; why didn&#8217;t you reply to my email yet!!!).</p>
<p style="text-align: center;"><img class="size-full wp-image-188 aligncenter" title="Gmail Spam Filter Creation Screenshot" src="http://www.marioawad.com/wp-content/uploads/2009/06/gmail-spam-filter-creation.png" alt="Gmail Spam Filter Creation Screenshot" width="450" height="150" /></p>
<p>What you have to do is create a new filter, add &#8220;in:spam&#8221; in the &#8220;Has the words&#8221; field, click next, ignore the warning given by Gmail (because, well, contrary to what they say, it works!!!), choose &#8220;Mark as read&#8221;, and click create filter.</p>
<p>Simple, efficient, and clean. Enjoy <img src='http://www.marioawad.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/marioblogfeed/~4/m75Syr77xIg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.marioawad.com/2009/06/18/hide-gmail-spam-count/</feedburner:origLink></item>
		<item>
		<title>URL Rewriting for CodeIgniter</title>
		<link>http://feeds.marioawad.com/~r/marioblogfeed/~3/4XJk0mZfigs/</link>
		<comments>http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/#comments</comments>
		<pubDate>Tue, 19 May 2009 17:43:11 +0000</pubDate>
		<dc:creator>Mario Awad</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.marioawad.com/?p=99</guid>
		<description><![CDATA[




		
			Email this to a friend?
		
		
			Send this page to Print Friendly
		
		
			Tweet This!
		
		
			Digg this!
		
		
			Share this on Facebook
		
		
			Share this on del.icio.us
		
		
			Share this on Linkedin
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Reddit
		
		
			Buzz up!
		
		
			Submit this to Script &#38; Style
		
		
			Subscribe to the comments for this post?
		
		
			Post this on Diigo
		
		
			Share this on Technorati
		
		
			Share this on Mixx
		
		
			Post this to MySpace
		
		
			Add [...]]]></description>
			<content:encoded><![CDATA[

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-mail">
			<a href="mailto:?subject=%22URL%20Rewriting%20for%20CodeIgniter%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22What%20is%20URL%20Rewriting%3F%0D%0AURL%20rewriting%20provides%20shorter%20and%20more%20relevant-looking%20links%20to%20web%20pages%20on%20your%20site.%20This%20improves%20the%20readability%20and%20the%20search%20rankings%20of%20your%20URLs.%20For%20example%2C%20URL%20%22a%22%20can%20be%20rewritten%20as%20URL%20%22b%22.%0D%0A%0D%0Aa%29%20http%3A%2F%2Fexample.com%2Findex.php%3Fsection%3Dcasting%0D%0Ab%29%20http%3A%2F%2Fexampl%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/" rel="nofollow" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="sexy-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/" rel="nofollow" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=URL+Rewriting+for+CodeIgniter+-+http://tinyurl.com/ykjc5hq+(via+@marioawad)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;t=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter&amp;summary=What%20is%20URL%20Rewriting%3F%0D%0AURL%20rewriting%20provides%20shorter%20and%20more%20relevant-looking%20links%20to%20web%20pages%20on%20your%20site.%20This%20improves%20the%20readability%20and%20the%20search%20rankings%20of%20your%20URLs.%20For%20example%2C%20URL%20%22a%22%20can%20be%20rewritten%20as%20URL%20%22b%22.%0D%0A%0D%0Aa%29%20http%3A%2F%2Fexample.com%2Findex.php%3Fsection%3Dcasting%0D%0Ab%29%20http%3A%2F%2Fexampl&amp;source=Mario Awad" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;submitHeadline=URL+Rewriting+for+CodeIgniter&amp;submitSummary=What%20is%20URL%20Rewriting%3F%0D%0AURL%20rewriting%20provides%20shorter%20and%20more%20relevant-looking%20links%20to%20web%20pages%20on%20your%20site.%20This%20improves%20the%20readability%20and%20the%20search%20rankings%20of%20your%20URLs.%20For%20example%2C%20URL%20%22a%22%20can%20be%20rewritten%20as%20URL%20%22b%22.%0D%0A%0D%0Aa%29%20http%3A%2F%2Fexample.com%2Findex.php%3Fsection%3Dcasting%0D%0Ab%29%20http%3A%2F%2Fexampl&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="sexy-scriptstyle">
			<a href="http://scriptandstyle.com/submit?url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Submit this to Script &amp; Style">Submit this to Script &amp; Style</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter&amp;desc=What%20is%20URL%20Rewriting%3F%0D%0AURL%20rewriting%20provides%20shorter%20and%20more%20relevant-looking%20links%20to%20web%20pages%20on%20your%20site.%20This%20improves%20the%20readability%20and%20the%20search%20rankings%20of%20your%20URLs.%20For%20example%2C%20URL%20%22a%22%20can%20be%20rewritten%20as%20URL%20%22b%22.%0D%0A%0D%0Aa%29%20http%3A%2F%2Fexample.com%2Findex.php%3Fsection%3Dcasting%0D%0Ab%29%20http%3A%2F%2Fexampl" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;t=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=URL+Rewriting+for+CodeIgniter&amp;link=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-wikio">
			<a href="http://www.wikio.com/sharethis?url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Share this on Wikio">Share this on Wikio</a>
		</li>
		<li class="sexy-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/+&quot;URL+Rewriting+for+CodeIgniter&quot;" rel="nofollow" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="sexy-posterous">
			<a href="http://posterous.com/share?linkto=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter&amp;selection=What%20is%20URL%20Rewriting%3F%0D%0AURL%20rewriting%20provides%20shorter%20and%20more%20relevant-looking%20links%20to%20web%20pages%20on%20your%20site.%20This%20improves%20the%20readability%20and%20the%20search%20rankings%20of%20your%20URLs.%20For%20example%2C%20URL%20%22a%22%20can%20be%20rewritten%20as%20URL%20%22b%22.%0D%0A%0D%0Aa%29%20http%3A%2F%2Fexample.com%2Findex.php%3Fsection%3Dcasting%0D%0Ab%29%20http%3A%2F%2Fexampl" rel="nofollow" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="sexy-pingfm">
			<a href="http://ping.fm/ref/?link=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter&amp;body=What%20is%20URL%20Rewriting%3F%0D%0AURL%20rewriting%20provides%20shorter%20and%20more%20relevant-looking%20links%20to%20web%20pages%20on%20your%20site.%20This%20improves%20the%20readability%20and%20the%20search%20rankings%20of%20your%20URLs.%20For%20example%2C%20URL%20%22a%22%20can%20be%20rewritten%20as%20URL%20%22b%22.%0D%0A%0D%0Aa%29%20http%3A%2F%2Fexample.com%2Findex.php%3Fsection%3Dcasting%0D%0Ab%29%20http%3A%2F%2Fexampl" rel="nofollow" title="Ping this on Ping.fm">Ping this on Ping.fm</a>
		</li>
		<li class="sexy-netvibes">
			<a href="http://www.netvibes.com/share?title=URL+Rewriting+for+CodeIgniter&amp;url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/" rel="nofollow" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="sexy-blogospherenews">
			<a href="http://www.blogospherenews.com/submit.php?url=http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/&amp;title=URL+Rewriting+for+CodeIgniter" rel="nofollow" title="Share this on Blogosphere News">Share this on Blogosphere News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<h2>What is URL Rewriting?</h2>
<p>URL rewriting provides shorter and more relevant-looking links to web pages on your site. This improves the readability and the search rankings of your URLs. For example, URL &#8220;a&#8221; can be rewritten as URL &#8220;b&#8221;.</p>
<p>a) http://example.com/index.php?section=casting<br />
b) http://example.com/casting</p>
<p>There are many articles on the web discussing the benefits of shorter and more relevant URLs. Let me add to them that you get to hide the used technology from both search engines and users. You&#8217;ll also have a better time migrating to a different platform in case you need to. For example, if you build your web application on top of ASP.NET and use URL Rewriting, you can easily migrate to PHP (Recommended, of course) without changing your links and hence without losing all the search-ranking score for those links.</p>
<h2>CodeIgniter Default URLs</h2>
<p>By default, CodeIgniter uses a segment-based approach to represent URLs. Unfortunately,  CodeIgniter includes the annoying &#8220;index.php&#8221; file name in the URL. For example:</p>
<p>http://example.com/index.php/products/view/shoes.</p>
<p>Now, the CodeIgniter manual mentions that it&#8217;s very simple to remove the &#8220;index.php&#8221; part from the URL using the following .htaccess file:</p>
<pre class="brush: plain;">
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
</pre>
<p>Problem solved? Not really. This didn&#8217;t work on my local machine nor on my online hosting account (<a href="http://www.dreamhost.com/r.cgi?482521">Dreamhost</a>). Why? I don&#8217;t know. I don&#8217;t care. I don&#8217;t currently have the time to find out why.</p>
<p>Having already installed Wordpress, I remembered that their .htaccess file works offline and online (at least in my case). I started playing around with it, checked some online resources, and devised two solutions. The local solution works on my local machine with the XAMPP server installed on it and the online solution works on my Dreamhost account.</p>
<h2>The Local Solution</h2>
<pre class="brush: plain;">
RewriteEngine On
RewriteBase /ci/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /ci/index.php/$1 [L]
</pre>
<p>The only change you need to make is to &#8220;ci&#8221; (on lines 2 and 5) which is the folder where you have your CodeIgniter application installed. In brief, this rewrite file tells your web server to apply the rewrite rule whenever a file or a directory is not found on the server. For example, if you invoke URL &#8220;c&#8221;, the &#8220;contact&#8221; folder is not found on your server (Since CodeIgniter files are in the &#8220;system&#8221; folder), and accordingly the URL is rewritten to &#8220;d&#8221;. This rewrite allows CodeIgniter to execute successfully (By using URL &#8220;d&#8221;) while giving you the benefits of shorter URLs (URL &#8220;c&#8221;).</p>
<p>c) http://localhost/ci/contact<br />
d) http://localhost/ci/index.php/contact</p>
<h2>The Online Solution</h2>
<pre class="brush: plain;">
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
</pre>
<p>There are no changes that you need to make for this .htaccess file. However, there&#8217;s one important note to mention. The question mark after &#8220;index.php&#8221; on line 5 is needed on my online hosting account at Dreamhost. You might want to remove it if it doesn&#8217;t work on yours. Again, I didn&#8217;t have the time to investigate why this is the case. Please check the additional resources for more details.</p>
<h2>Conclusion</h2>
<p>I hope this post saves you a few headaches I had to go through to solve this problem. I would love to see such a solution coming out of the box with the next version of CodeIgniter. If you have any hints or additional information regarding URL rewriting in the context of CodeIgniter, please share them in the comments.</p>
<h2>Additional Resources</h2>
<p>CodeIgniter URLs<br />
<a href="http://codeigniter.com/user_guide/general/urls.html"> http://codeigniter.com/user_guide/general/urls.html</a></p>
<p>URL Rewriting for Beginners<br />
<a href="http://www.addedbytes.com/apache/url-rewriting-for-beginners/"> http://www.addedbytes.com/apache/url-rewriting-for-beginners/</a></p>
<p>An easy way to test your RewriteRules against different URLs<br />
<a href="http://civilolydnad.se/projects/rewriterule/"> http://civilolydnad.se/projects/rewriterule/</a></p>
<p>Dreamhost and CodeIgniter URLs<br />
<a href="http://codeigniter.com/forums/viewthread/55620/"> http://codeigniter.com/forums/viewthread/55620/</a></p>
<img src="http://feeds.feedburner.com/~r/marioblogfeed/~4/4XJk0mZfigs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.marioawad.com/2009/05/19/url-rewriting-for-codeigniter/</feedburner:origLink></item>
		<item>
		<title>Hello world!</title>
		<link>http://feeds.marioawad.com/~r/marioblogfeed/~3/G9t3K1-5H50/</link>
		<comments>http://www.marioawad.com/2009/03/16/hello-world/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 15:02:05 +0000</pubDate>
		<dc:creator>Mario Awad</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.marioawad.com/?p=1</guid>
		<description><![CDATA[




		
			Email this to a friend?
		
		
			Send this page to Print Friendly
		
		
			Tweet This!
		
		
			Digg this!
		
		
			Share this on Facebook
		
		
			Share this on del.icio.us
		
		
			Share this on Linkedin
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Reddit
		
		
			Buzz up!
		
		
			Submit this to Script &#38; Style
		
		
			Subscribe to the comments for this post?
		
		
			Post this on Diigo
		
		
			Share this on Technorati
		
		
			Share this on Mixx
		
		
			Post this to MySpace
		
		
			Add [...]]]></description>
			<content:encoded><![CDATA[

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-mail">
			<a href="mailto:?subject=%22Hello%20world%21%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22The%20ubiquitous%20Hello%20World%20post%20is%20here%20to%20stay.%20For%20the%20sake%20of%20programming%20traditions%2C%20I%27m%20not%20removing%20it.%20But%20I%20do%20promise%20that%20my%20next%20post%20will%20be%20more%20useful.%20%3A%29%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://www.marioawad.com/2009/03/16/hello-world/" rel="nofollow" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="sexy-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://www.marioawad.com/2009/03/16/hello-world/" rel="nofollow" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Hello+world%21+-+http://tinyurl.com/yl6gfct+(via+@marioawad)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.marioawad.com/2009/03/16/hello-world/&amp;t=Hello+world%21" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21&amp;summary=The%20ubiquitous%20Hello%20World%20post%20is%20here%20to%20stay.%20For%20the%20sake%20of%20programming%20traditions%2C%20I%27m%20not%20removing%20it.%20But%20I%20do%20promise%20that%20my%20next%20post%20will%20be%20more%20useful.%20%3A%29&amp;source=Mario Awad" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://www.marioawad.com/2009/03/16/hello-world/&amp;submitHeadline=Hello+world%21&amp;submitSummary=The%20ubiquitous%20Hello%20World%20post%20is%20here%20to%20stay.%20For%20the%20sake%20of%20programming%20traditions%2C%20I%27m%20not%20removing%20it.%20But%20I%20do%20promise%20that%20my%20next%20post%20will%20be%20more%20useful.%20%3A%29&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="sexy-scriptstyle">
			<a href="http://scriptandstyle.com/submit?url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21" rel="nofollow" title="Submit this to Script &amp; Style">Submit this to Script &amp; Style</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.marioawad.com/2009/03/16/hello-world/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21&amp;desc=The%20ubiquitous%20Hello%20World%20post%20is%20here%20to%20stay.%20For%20the%20sake%20of%20programming%20traditions%2C%20I%27m%20not%20removing%20it.%20But%20I%20do%20promise%20that%20my%20next%20post%20will%20be%20more%20useful.%20%3A%29" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.marioawad.com/2009/03/16/hello-world/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.marioawad.com/2009/03/16/hello-world/&amp;t=Hello+world%21" rel="nofollow" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21" rel="nofollow" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Hello+world%21&amp;link=http://www.marioawad.com/2009/03/16/hello-world/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-wikio">
			<a href="http://www.wikio.com/sharethis?url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21" rel="nofollow" title="Share this on Wikio">Share this on Wikio</a>
		</li>
		<li class="sexy-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://www.marioawad.com/2009/03/16/hello-world/+&quot;Hello+world%21&quot;" rel="nofollow" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="sexy-posterous">
			<a href="http://posterous.com/share?linkto=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21&amp;selection=The%20ubiquitous%20Hello%20World%20post%20is%20here%20to%20stay.%20For%20the%20sake%20of%20programming%20traditions%2C%20I%27m%20not%20removing%20it.%20But%20I%20do%20promise%20that%20my%20next%20post%20will%20be%20more%20useful.%20%3A%29" rel="nofollow" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="sexy-pingfm">
			<a href="http://ping.fm/ref/?link=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21&amp;body=The%20ubiquitous%20Hello%20World%20post%20is%20here%20to%20stay.%20For%20the%20sake%20of%20programming%20traditions%2C%20I%27m%20not%20removing%20it.%20But%20I%20do%20promise%20that%20my%20next%20post%20will%20be%20more%20useful.%20%3A%29" rel="nofollow" title="Ping this on Ping.fm">Ping this on Ping.fm</a>
		</li>
		<li class="sexy-netvibes">
			<a href="http://www.netvibes.com/share?title=Hello+world%21&amp;url=http://www.marioawad.com/2009/03/16/hello-world/" rel="nofollow" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="sexy-blogospherenews">
			<a href="http://www.blogospherenews.com/submit.php?url=http://www.marioawad.com/2009/03/16/hello-world/&amp;title=Hello+world%21" rel="nofollow" title="Share this on Blogosphere News">Share this on Blogosphere News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<p>The ubiquitous Hello World post is here to stay. For the sake of programming traditions, I&#8217;m not removing it. But I do promise that my next post will be more useful. <img src='http://www.marioawad.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/marioblogfeed/~4/G9t3K1-5H50" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.marioawad.com/2009/03/16/hello-world/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.marioawad.com/2009/03/16/hello-world/</feedburner:origLink></item>
	</channel>
</rss>
