<?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>MIKESTOWE.COM</title>
	<atom:link href="http://www.mikestowe.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mikestowe.com</link>
	<description>Just another php, religion, and politics weblog</description>
	<lastBuildDate>Thu, 03 May 2012 19:47:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>User First&#8230; Not Mobile First</title>
		<link>http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php</link>
		<comments>http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php#comments</comments>
		<pubDate>Wed, 18 Apr 2012 01:54:40 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[responsive design]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=1100</guid>
		<description><![CDATA[<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=20320310172&amp;xfbml=1"></script><script language="JavaScript">
					FB.Event.subscribe('edge.create', function(response) {
						_gaq.push(['_trackEvent','SocialSharing','Facebook - like button',unescape(String(response).replace(/\+/g, " "))]);
					});
				</script>Right now &#8220;Responsive Design&#8221; seems to be the big buzz word in the design industry. Designers, much like us developers, are lazy. We want code reusability, the option to do things ONE TIME, and not have to make the same update several times for each little change. Enter &#8220;Responsive Design,&#8221; or a one-size-fits-all solution for [...]]]></description>
			<content:encoded><![CDATA[<p>Right now &#8220;Responsive Design&#8221; seems to be the big buzz word in the design industry.  Designers, much like us developers, are lazy.  We want code reusability, the option to do things ONE TIME, and not have to make the same update several times for each little change.</p>
<p>Enter &#8220;Responsive Design,&#8221; or a one-size-fits-all solution for developing web pages and applications.  The problem however, is that while for some sites this approach may work, it doesn&#8217;t for all sites.  The more content you add, the more features you add, the more complex your site becomes&#8230; and let&#8217;s face it, there are some things you can do on a desktop browser that you really shouldn&#8217;t on a mobile (ie phone) display.</p>
<p>To solve this dilemma, a great idea was born.  Let&#8217;s develop for mobile displays first&#8230; after all, for years we have taken a desktop first approach.  The problem is that this doesn&#8217;t fix the problem, but only shifts it.  While it makes sense to find the most relevant data and place it first, we have to keep in mind the formatting of the users device, and the purpose of the user for visiting our site on that device.</p>
<p>For example, if you are visiting CNN, you want news.  You probably don&#8217;t care as much about their daily poll, and I&#8217;m guessing you don&#8217;t want to have to scroll through all 2,000 sections to find the stories you want.  Instead, CNN wisely provides you with the most relevant news to you &#8211; with the option to browse to the more refined areas should you choose.  Likewise, checking weather.com on your mobile device probably means you want to know your local weather, and could probably care less about what&#8217;s playing on the Weather Channel right now.  Maybe you want to watch an episode of Storm Chasers, or take a look at videos from Hawaii, but for most people, they just want to know whether or not it&#8217;s going to keep snowing in April in Minnesota.</p>
<p>So keeping this in mind, we need to find a versatile solution.  Sure we can create one site with responsive design to accommodate all these different devices, but we are still limited in our ability to provide a smooth, user friendly experience without hogging up all of the user&#8217;s wireless data.  Too much and the site takes forever to load, causing users to simply flee&#8230; not enough on the desktop and users may not find it stimulating or useful enough.</p>
<p>Then again, we could create specific sites for every single device, one for the iPhone, one for the iPad, and 10,000 for the different sized and capable Android devices.</p>
<p>So why not join these two concepts?  As mobile devices become more prevalent, we won&#8217;t be limited to cell phones, tablets, netbooks, and computers.  Instead, people will be checking recipes on their refrigerator, local searches in their car, pulling up your site by clicking on your ad on TV, or even visiting your site using a pair of Google glasses.</p>
<p>The simple fact is, we can&#8217;t possibly make a one-size-fits-all solution that covers all of these dynamics.  Well, maybe we can, but not for heavy content sites or web applications.</p>
<p>But we can streamline the process by utilizing responsive design within our specialized applications.  We can develop a phone system that works on the majority of mobile devices, without sacrificing content and without maxing out wireless data.</p>
<p>Overall, the solution(s) depend on what&#8217;s best for your users, not what&#8217;s most convenient for you or your designers.  It becomes an economic question, and while we are quick to jump to the savings, we also have to evaluate and take into consideration the possibility for revenues.  Does a mobile friendly site make sense, well, will the benefits of usability increase revenues and customers enough to balance out or outweigh the costs of maintaining it.  If so, even if it&#8217;s a draw, the user experience is worth it.</p>
<p>Keep in mind that we are in a fascinating time technologically speaking.  We have new challenges as more and more users bog down data networks.  At the same time, new technologies such as flexible glass are being perfected, and with the increased demand a whole new world of mobile and home technological possibilities.  </p>
<p>If we get too stuck in the mobile first mindset, we may find ourselves having just the opposite dilemma.  When someone wakes up and their wall lights up, they may find themselves stuck with a 320x480px website blown to fuzzy, unreadable proportions.  We have to not only design for today, but with the future in mind.  A future that isn&#8217;t restricted to mobile only, and in which mobile devices as we know it may become completely obliterated.</p>
<p>And economically, perhaps more important than designing for the future, we need to design for the user.  Providing the most convenient solution for them in the present day.</p>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php&text=User+First%26%238230%3B+Not+Mobile+First" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php&title=User+First%26%238230%3B+Not+Mobile+First&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=User+First%26%238230%3B+Not+Mobile+First&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F04%2Fuser-first-not-mobile-first.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/04/user-first-not-mobile-first.php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DB::DBAL</title>
		<link>http://www.mikestowe.com/2012/02/dbdbal.php</link>
		<comments>http://www.mikestowe.com/2012/02/dbdbal.php#comments</comments>
		<pubDate>Mon, 20 Feb 2012 23:39:54 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[DB::DBAL]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=984</guid>
		<description><![CDATA[DB::DBAL has been moved to http://dbal.mikestowe.com. DB::DBAL is a lightweight Database Abstraction Layer that is designed to allow for multiple database types and connections simultaneously. DB::DBAL provides ease of use of use through query chaining, security via automatic where clause escaping, as well as code reusability through the ability to add universal events for table [...]]]></description>
			<content:encoded><![CDATA[<hr />
<p><strong style="font-size: 16px;">DB::DBAL has been moved to <a href="http://dbal.mikestowe.com">http://dbal.mikestowe.com</a>.</strong></p>
<hr />
<p>DB::DBAL is a lightweight Database Abstraction Layer that is designed to allow for multiple database types and connections simultaneously.  DB::DBAL provides ease of use of use through query chaining, security via automatic where clause escaping, as well as code reusability through the ability to add universal events for table queries (pre/post fetch, insert, update, or save).</p>
<p>An example DB::DBAL MySQL setup and call might look like this:<br />
<pre><code>// Require the DB Class
require_once('classes/DB.php');

// Setup a Connection (saving it is optional and allows you to go back and forth)
DB::MySQL()-&gt;connect('localhost','username','password')-&gt;saveConnectionAs('default');

// Select Database
DB::MySQL()-&gt;db('exampleDatabase');

$result = DB::MySQL()-&gt;table('MyTable')-&gt;select()-&gt;where('column = ?', $data)-&gt;fetchOne();
echo $result-&gt;name; //name column</code></pre></p>
<p>DB::DBAL also maps the data to an object and allows for quick data manipulation and saving through the save() method:</p>
<p><pre><code>$result-&gt;name = 'New Name';
$result-&gt;save();</code></pre></p>
<p>Along with mapping and saving the new data, DB::DBAL remembers old data and allows for easy access of data that has been changed through the oldData() and changedData() methods:</p>
<p><pre><code>var_dump($result-&gt;oldData()); // returns an array of Old Data

var_dump($result-&gt;changedData()); // returns an array of columns with old and new values
var_dump($result-&gt;changedData('name')); // returns the new value of the column name
var_dump($result-&gt;changedData('name', 'old'); // returns the old value of the column name</code></pre></p>
<p>To retrieve the count of selected rows, affected rows, or insert id, DB:DBAL provides the following methods:<br />
<pre><code>$result-&gt;count(); // number of rows in query
$result-&gt;affectedRows(); // number of rows effected by save/ insert/ update
$result-&gt;insertId(); // insert ID if a new record</code></pre></p>
<p>DB::DBAL also allows for array based data insertion or record updating:<br />
<pre><code>// Update All Records
DB::MySQL()-&gt;table('MyTable')-&gt;update(array('name' =&gt; 'New Name'))-&gt;save();

// With Where Clause
DB::MySQL()-&gt;table('MyTable')-&gt;update(array('name' =&gt; 'New Name'))-&gt;where('name = ?', 'Old Name')-&gt;save();

// Insert Record
DB::MySQL()-&gt;table('MyTable')-&gt;insert(array('name' =&gt; 'New Name'))-&gt;save();</code></pre></p>
<p>DB::DBAL also contains a Models folder in the classes/DB/ folder.  Models allow you to create table classes (based on database type, database name, and table name) that will have event methods run on certain actions.  For example, you can create a postSave() method in the table class to perform a specific set of actions everytime data is updated or inserted into that specific table.  This may mean formatting the data a specific way or porting data to other tables.</p>
<p>For more on models, read the ReadMe.txt file in the Models/ folder.</p>
<p><strong><br />
Installing DB::DBAL</strong><br />
DB::DBAL can be run on any server utilizing PHP 5.3+</p>
<p><strong>Bugs</strong></p>
<ul>
<li>No known errors</li>
</ul>
<p><strong><br />
Awards (Yay)</strong> <em>- listed in the order received</em><br />
We&#8217;re working on this&#8230; lol</p>
<p><strong>Usage</strong><br />
DB::DABL was released under the <a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GPL version 2 license</a>. </p>
<p><strong> </strong></p>
<p><strong>Download<br />
</strong></p>
<p>Note &#8211; DB::DBAL is in pre-alpha release and is currently being developed.  Please feel free to download, test, and commit changes to help improve this application.  Future implementations will include MySQLi, other databases, and more caching options.  Oh yeah, it will also include documentation &#8211; feel free to commit documentation/ doc blox as well!</p>
<p><center><a href="https://github.com/mikestowe/" target="_blank"><div style="width: 476px; height: 35px; background: #FAFAFA url(http://www.mikestowe.com/wp-content/uploads/2010/09/github.jpg) no-repeat 0px 5px; border: 1px solid #CCC; color: #333; font-weight: normal; text-decoration: none; margin: -10px 0px 20px 0px; text-align: left; padding: 12px 0px 0px 125px;"><span style="font-weight: bold; font-size: 12px; color: #333;">https://github.com/mikestowe/</span></div></a></center></p>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/02/dbdbal.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php&text=DB%3A%3ADBAL" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/02/dbdbal.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/02/dbdbal.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php&title=DB%3A%3ADBAL&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/02/dbdbal.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/02/dbdbal.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/02/dbdbal.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=DB%3A%3ADBAL&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/02/dbdbal.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/02/dbdbal.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/02/dbdbal.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/02/dbdbal.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fdbdbal.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/02/dbdbal.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic SVN Commands</title>
		<link>http://www.mikestowe.com/2012/02/basic-svn-commands.php</link>
		<comments>http://www.mikestowe.com/2012/02/basic-svn-commands.php#comments</comments>
		<pubDate>Fri, 03 Feb 2012 23:25:47 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Resources]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=965</guid>
		<description><![CDATA[Here are some basic, but important SVN commands to know: Checkout a Repository svn checkout http://... Update local repository svn update Commit all changes in local directory svn commit -m &#34;message&#34; Commit specific changes svn commit -m &#34;message&#34; file1 file2 file3 Revert or Undo Your Changes svn revert file List the last 5 revisions svn [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some basic, but important SVN commands to know:</p>
<p><strong>Checkout a Repository</strong><br />
<pre><code>svn checkout http://...</code></pre></p>
<p><strong>Update local repository</strong><br />
<pre><code>svn update</code></pre></p>
<p><strong>Commit all changes in local directory</strong><br />
<pre><code>svn commit -m &quot;message&quot;</code></pre></p>
<p><strong>Commit specific changes</strong><br />
<pre><code>svn commit -m &quot;message&quot; file1 file2 file3</code></pre></p>
<p><strong>Revert or Undo Your Changes</strong><br />
<pre><code>svn revert file</code></pre></p>
<p><strong>List the last 5 revisions</strong><br />
<pre><code>svn log --limit=5</code></pre></p>
<p><strong>List the last 5 revisions for a specific file</strong><br />
<pre><code>svn log --limit=5 file</code></pre></p>
<p><strong>Show differences between repositories</strong><br />
<pre><code>svn diff</code></pre></p>
<p><strong>Show differences for a specific file</strong><br />
<pre><code>svn diff file</code></pre></p>
<p><strong>Show differences between revisions</strong><br />
<pre><code>svn diff -r revision1:revision2</code></pre></p>
<p><strong>Show differences between revisions for specific files</strong><br />
<pre><code>svn diff -r revision1:revision2 file1 file2 file3</code></pre></p>
<p><strong>Show differences compared to last revision</strong><br />
<pre><code>svn diff -c revision</code></pre></p>
<p><strong>Port Differences to VIM Editor</strong><br />
<pre><code>svn diff | vim -</code></pre></p>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php&text=Basic+SVN+Commands" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php&title=Basic+SVN+Commands&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=Basic+SVN+Commands&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/02/basic-svn-commands.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fbasic-svn-commands.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/02/basic-svn-commands.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Form Builder</title>
		<link>http://www.mikestowe.com/2012/02/form-builder.php</link>
		<comments>http://www.mikestowe.com/2012/02/form-builder.php#comments</comments>
		<pubDate>Fri, 03 Feb 2012 22:15:01 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Form Builder]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=955</guid>
		<description><![CDATA[To be perfectly honest, this is a class I built awhile ago (back in November of 2010), so going from memory here. But basically, Form Builder allows you to setup a databased/ emailed form quickly and easily, in just a few lines of code. For example, to build and process a form that contains 8 [...]]]></description>
			<content:encoded><![CDATA[<p>To be perfectly honest, this is a class I built awhile ago (back in November of 2010), so going from memory here.  But basically, Form Builder allows you to setup a databased/ emailed form quickly and easily, in just a few lines of code.</p>
<p>For example, to build and process a form that contains 8 form elements and 2 content blocks, the code would be as follows:</p>
<p><pre><code>&lt;?php
require_once('form.php');
$form = new form;

//            SEND FORM TO               SUBJECT
$form-&gt;email('email@emailaddress.com','Form Test');

//  FIELD TYPE   DB COLUMN   LABEL     DEFAULT VALUE  REQUIRED  REQUIRED MESSAGE    ADD TEXT     OPTIONS (ARRAY)
$form-&gt;content('&lt;h2 style=&quot;margin-bottom: 0px;&quot;&gt;Welcome to My Form&lt;/h2&gt;&lt;span style=&quot;font-family: arial; font-size: 12px; color: #666;&quot;&gt;8 Fields, 2 content blocks... 14 lines of code&lt;br /&gt;&lt;/span&gt;');
$form-&gt;add('text',false,'What\'s Your Name','Bob',true,'Please Fill in Your Name','*');
$form-&gt;add('text',false,'What\'s Your Email','',true,'Please Fill in Your Email','*&lt;br /&gt;&lt;small&gt;&lt;em&gt;note: this script will automatically detect this when sending the email!&lt;/em&gt;&lt;/small&gt;');
$form-&gt;add('text',false,'What\'s Your Name','Bob3',false,'Please Fill in Your Name');
$form-&gt;add('text',false,'What\'s Your Name','Bob4',false,'Please Fill in Your Name');
$form-&gt;add('text',false,'What\'s Your Name','Bob5',false,'Please Fill in Your Name');
$form-&gt;add('select',false,'What\'s Your Name','Bob5',false,'Please Select in Your Name','*',array('Mike'=&gt;'Mike','Bob'=&gt;'Bob','John'=&gt;'John','Bob5'=&gt;'Bob5'));
$form-&gt;add('radio',false,'What\'s Your Name','Bob5',true,'Please Select in Your Name','*',array('Mike'=&gt;'Mike','Bob'=&gt;'Bob','John'=&gt;'John','Bob5'=&gt;'Bob5'));
$form-&gt;add('checkbox',false,'What\'s Your Name','',true,'Please Check Your Name','*',array('Mike'=&gt;'Mike','Bob'=&gt;'Bob','John'=&gt;'John','Bob5'=&gt;'Bob5'));
$form-&gt;content('&lt;span style=&quot;color: #990000;&quot;&gt;By clicking the submit button you are agreeing that this is the coolest form class ever...&lt;/span&gt;');
$form-&gt;build();
?&gt;</code></pre></p>
<p>Form Builder automatically adds CSS classes to the form fields, and allows for quick, easy CSS customization to the form as follows:</p>
<p><pre><code>.form_error { width: 40%; margin: 0px auto; background: #f3f3f3; border: 1px solid #990000; color: #990000; font-weight: bold; padding: 10px;}

.form_success { width: 40%; margin: 0px auto; background: #f3f3f3; border: 1px solid #009900; color: #009900; font-weight: bold; padding: 10px;}

.form_label { width: 150px; float: left; margin-right: 10px;}

.form_field { float: left; }

.form_row { clear: both; border-bottom: 1px dotted #ccc; margin-bottom: 5px; padding-bottom: 5px; }</code></pre></p>
<p>This results in the following form (note- the form has been submitted to demonstrate required field validation):<br />
<center><a href="http://www.mikestowe.com/wp-content/uploads/2012/02/screenshot.png"><img src="http://www.mikestowe.com/wp-content/uploads/2012/02/screenshot-276x300.png" alt="" title="screenshot" width="368" height="400" class="size-medium wp-image-959" /></a></center></p>
<p><strong><br />
Installing Form-Builder</strong><br />
Form Builder can be run on any server utilizing PHP 5+</p>
<p><strong>Bugs</strong></p>
<ul>
<li>No known errors</li>
</ul>
<p><strong><br />
Awards (Yay)</strong> <em>- listed in the order received</em><br />
We&#8217;re working on this&#8230; lol</p>
<p><strong>Usage</strong><br />
smrtClass was released under the <a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GPL version 2 license</a>. </p>
<p><strong> </strong></p>
<p><strong>Download<br />
</strong></p>
<p><center><a href="https://github.com/mikestowe/Form-Builder" target="_blank"><div style="width: 476px; height: 35px; background: #FAFAFA url(http://www.mikestowe.com/wp-content/uploads/2010/09/github.jpg) no-repeat 0px 5px; border: 1px solid #CCC; color: #333; font-weight: normal; text-decoration: none; margin: -10px 0px 20px 0px; text-align: left; padding: 12px 0px 0px 125px;"><span style="font-weight: bold; font-size: 12px; color: #333;">https://github.com/mikestowe/Form-Builder</span></div></a></center></p>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/02/form-builder.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php&text=Form+Builder" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/02/form-builder.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/02/form-builder.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php&title=Form+Builder&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/02/form-builder.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/02/form-builder.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/02/form-builder.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=Form+Builder&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/02/form-builder.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/02/form-builder.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/02/form-builder.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/02/form-builder.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F02%2Fform-builder.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/02/form-builder.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly PHP Test</title>
		<link>http://www.mikestowe.com/2012/01/weekly-php-test-6.php</link>
		<comments>http://www.mikestowe.com/2012/01/weekly-php-test-6.php#comments</comments>
		<pubDate>Mon, 30 Jan 2012 07:00:59 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Weekly Test]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=916</guid>
		<description><![CDATA[What is the output of the following code? echo (string) 042; &#8230; &#8230; &#8230; &#8230; &#8230; &#8230; &#8230; &#8230; &#8230; ANSWER: 34 Because the number starts with a zero, it is interpreted as an Octal number instead of a decimal. This means instead of returning 42 as one might expect, it returns the octal calculation: [...]]]></description>
			<content:encoded><![CDATA[<p>What is the output of the following code?</p>
<p><pre><code>echo (string) 042;</code></pre></p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p><strong>ANSWER:</strong></p>
<p><pre><code>34</code></pre></p>
<p>Because the number starts with a zero, it is interpreted as an Octal number instead of a decimal.  This means instead of returning 42 as one might expect, it returns the octal calculation:</p>
<p>0 = signify Octal<br />
4 = 4 x <strong>8</strong> = 32<br />
2 = 2 X <strong>1</strong> = 2<br />
&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
34</p>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php&text=Weekly+PHP+Test" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php&title=Weekly+PHP+Test&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=Weekly+PHP+Test&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/01/weekly-php-test-6.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-6.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/01/weekly-php-test-6.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool Tricks</title>
		<link>http://www.mikestowe.com/2012/01/cool-tricks.php</link>
		<comments>http://www.mikestowe.com/2012/01/cool-tricks.php#comments</comments>
		<pubDate>Tue, 24 Jan 2012 00:57:36 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Just for Fun]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=921</guid>
		<description><![CDATA[More cool tricks]]></description>
			<content:encoded><![CDATA[<p><iframe width="480" height="360" src="http://www.youtube.com/embed/BYK3W9WqbGw" frameborder="0" allowfullscreen></iframe></p>
<p><a href="http://www.youtube.com/watch?feature=player_profilepage&#038;v=i_f3SkxTWxc" target="_blank">More cool tricks</a></p>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/01/cool-tricks.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php&text=Cool+Tricks" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/01/cool-tricks.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/01/cool-tricks.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php&title=Cool+Tricks&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/01/cool-tricks.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/01/cool-tricks.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/01/cool-tricks.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=Cool+Tricks&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/01/cool-tricks.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/01/cool-tricks.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/01/cool-tricks.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/01/cool-tricks.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fcool-tricks.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/01/cool-tricks.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly PHP Test</title>
		<link>http://www.mikestowe.com/2012/01/weekly-php-test-5.php</link>
		<comments>http://www.mikestowe.com/2012/01/weekly-php-test-5.php#comments</comments>
		<pubDate>Mon, 23 Jan 2012 07:00:32 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Weekly Test]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=913</guid>
		<description><![CDATA[What does the following code echo out: if('ORANGE' &#62; 'apple') { echo 'orange'; } else { echo 'apple'; } &#8230; &#8230; &#8230; &#8230; &#8230; &#8230; ANSWER: apple The values are converted based on the ASCII alphabet, in which uppercase letters come before lowercase letters, and thus are assigned a lower value than the lowercase letters. [...]]]></description>
			<content:encoded><![CDATA[<p>What does the following code echo out:</p>
<p><pre><code>if('ORANGE' &gt; 'apple') {
    echo 'orange';
} else {
    echo 'apple';
}</code></pre></p>
<p><span id="more-913"></span></p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p><strong>ANSWER:</strong><br />
<pre><code>apple</code></pre></p>
<p>The values are converted based on the ASCII alphabet, in which uppercase letters come before lowercase letters, and thus are assigned a lower value than the lowercase letters.  This means that the word &#8216;apple&#8217; is assigned a higher value than the word &#8216;ORANGE&#8217; because of the case-sensitivity, making &#8216;apple&#8217; greater than &#8216;ORANGE.&#8217;  When we change &#8216;ORANGE&#8217; to lowercase, the otherwise same code would return &#8216;orange.&#8217;</p>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php&text=Weekly+PHP+Test" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php&title=Weekly+PHP+Test&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=Weekly+PHP+Test&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/01/weekly-php-test-5.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-5.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/01/weekly-php-test-5.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.4 – First Glances</title>
		<link>http://www.mikestowe.com/2012/01/php-5-4-first-glances.php</link>
		<comments>http://www.mikestowe.com/2012/01/php-5-4-first-glances.php#comments</comments>
		<pubDate>Mon, 16 Jan 2012 22:47:21 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=843</guid>
		<description><![CDATA[Updated February 10, 2012 PHP 5.4 is just around the corner, and with it several new features and enhancements.  Here are just a few of the features I&#8217;ve had the chance to play with that may be useful. Binary Integer Notation Previously in PHP, you were able to write integers as decimals (10), Octals (012), [...]]]></description>
			<content:encoded><![CDATA[<p><strong><em>Updated February 10, 2012</em></strong></p>
<p>PHP 5.4 is just around the corner, and with it several new features and enhancements.  Here are just a few of the features I&#8217;ve had the c</em>hance to play with that may be useful.</p>
<h3><span style="font-weight: bold;">Binary Integer Notation</span></h3>
<p>Previously in PHP, you were able to write integers as decimals (10), Octals (012), and Hexadecimals (0xA).   Now in PHP 5.4 you can use binary notation for integers by preceding the binary number with &#8220;0b&#8221; &#8211; such as (0b1010).</p>
<p><pre><code>// Decimal
echo (string) 10; // 10

// Octal
echo (string) 012; // 10

// Hexadecimal
echo (string) 0xA; // 10

// Binary
echo (string) 0b1010; // 10</code></pre></p>
<h3><span style="font-weight: bold;">Session Status</span></h3>
<p>PHP 5.4 introduces a new session function designed to explain the current status of the session.  The session_status() function will return the following responses:</p>
<p><tt>PHP_SESSION_DISABLED</tt> if sessions are disabled.<br />
<tt>PHP_SESSION_NONE</tt> if sessions are enabled, but none exists.<br />
<tt>PHP_SESSION_ACTIVE</tt> if sessions are enabled, and one exists.</p>
<p>For example:<br />
<pre><code>&lt;?php
echo session_status(); // echos PHP_SESSION_NONE
session_start();
echo session_status(); // echos PHP_SESSION_ACTIVE
?&gt;</code></pre></p>
<p>PHP 5.4 also introduces the <a href="http://php.oregonstate.edu/manual/en/class.sessionhandler.php" target="_blank">SessionHandler</a> class to provide more flexibility and standardization in how sessions are handled.</p>
<h3><span style="font-weight: bold;">Arrays</span></h3>
<p>Finally, in PHP you can now use the short bracket syntax for arrays.  While really not a huge deal, this aligns PHP with many of the other programming languages, and will probably make switching from another language just a little easier (although array(1,2,3) is pretty simple).<br />
<pre><code>$oldArray = array(1,2,3);
echo (string) $oldArray[1]; // 2

$newArray = [1,2,3];
echo (string) $newArray[1]; // 2</code></pre><br />
Another nice feature in regards to arrays is Array Dereferencing, or being able to access an array object directly off of a method or function.<br />
<pre><code>function getArray()
{
    return array(1,2,3);
    // or return [1,2,3]; in PHP 5.4 ;)
}

// PHP 5.3
echo (string) getArray()[1]; // error

// PHP 5.4
echo (string) getArray()[1]; // 2</code></pre></p>
<h3>Class Instantiation Chaining</h3>
<p><strong> </strong>Also in PHP 5.4, class instantiation chaining was added, allowing you to chain off of the instantiation of a class by using parentheses.<br />
<pre><code>class Test
{
    public function hello()
    {
        echo 'hello world';
    }
}

// in PHP 5.3 this would be an error
// in PHP 5.4 it echos 'hello world'
echo (new Test())-&gt;hello();</code></pre></p>
<h3><strong>Traits</strong></h3>
<p><strong> </strong>Ok, this is a super simple overview of traits, but the addition of traits provides the flexibility of &#8220;extending&#8221; multiple classes without having to go through an entire chain.  Unlike many languages, PHP Traits can also contain properties, however, if the class contains a property with the same name it will throw an E_STRICT warning IF the class property === the trait property, or a fatal error if the class property !== the trait property.</p>
<p>To use a trait, you would write something like this:<br />
<pre><code>trait MyTrait()
{
    public $MyProperty = 'hello';

    public function MyMethod()
    {
        echo 'world';
    }
}

class MyClass()
{
    use MyTrait;

    public function DoStuff()
    {
        echo $this-&gt;MyProperty;
        echo ' ';
        $this-&gt;MyMethod();
    }
}

(new MyClass())-&gt;DoStuff(); // echos out 'hello world'</code></pre></p>
<h3><strong>More to Come!</strong></h3>
<p><strong> </strong>There&#8217;s a lot more features in PHP 5.4 that I still need to explore, including PHP Session Uploading, improved Closures, and a built in HTTP server.  So stay tuned and I will try to give a quick overview of those as well as soon as I can get enough time to play with them <img src="http://www.mikestowe.com/wp-includes/images/smilies/icon_smile.gif"  style="border: none;" /></p>
<p><em>Note: Code is based on PHP 5.4 RC 4</em></p>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php&text=PHP+5.4+%E2%80%93+First+Glances" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php&title=PHP+5.4+%E2%80%93+First+Glances&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=PHP+5.4+%E2%80%93+First+Glances&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/01/php-5-4-first-glances.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fphp-5-4-first-glances.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/01/php-5-4-first-glances.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly PHP Test</title>
		<link>http://www.mikestowe.com/2012/01/weekly-php-test-4.php</link>
		<comments>http://www.mikestowe.com/2012/01/weekly-php-test-4.php#comments</comments>
		<pubDate>Mon, 16 Jan 2012 15:33:33 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Weekly Test]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=782</guid>
		<description><![CDATA[True or False: In PHP 5.4 Traits can have properties? .. .. .. .. .. .. .. .. .. .. ANSWER: True! In PHP 5.4 Traits may contain properties as long as properties do not exist in the calling class. But beware, if the property already exists PHP will throw an error (fatal if the [...]]]></description>
			<content:encoded><![CDATA[<p>True or False: In PHP 5.4 Traits can have properties?</p>
<p><span id="more-782"></span><br />
..</p>
<p>..</p>
<p>..</p>
<p>..</p>
<p>..</p>
<p>..</p>
<p>..</p>
<p>..</p>
<p>..</p>
<p>..</p>
<p><strong>ANSWER:</strong></p>
<blockquote><p>True!</p>
<p>In PHP 5.4 Traits may contain properties as long as properties do not exist in the calling class.  But beware, if the property already exists PHP will throw an error (fatal if the property isn&#8217;t identical to the trait property, and E_STRICT if it is).</p>
<p><pre><code>trait demo {
    public $demo = 'this is a demo';
    public $test = 'this is a test';

    public function cool() {
        /* this is the method */
    }

    /* ... */
}</code></pre></p>
<p><strong>Valid</strong><br />
<pre><code>trait testTrait {
    public $demo = 'test';
}

class testClass {
    use testTrait;

    function test() {
        echo $this-&gt;demo;
    }

    /* ... */
}</code></pre></p>
<p><strong>E_STRICT Error</strong><br />
<pre><code>trait testTrait {
    public $demo = 'test';
}

class testClass {
    use testTrait;

    public $demo = 'test';

    /* ... */
}</code></pre></p>
<p><strong>Fatal Error:</strong><br />
<pre><code>trait testTrait {
    public $demo = 10;
}

class testClass {
    use testTrait;

    public $demo = 'test';

    /* ... */
}</code></pre></p>
<p><strong>Fatal Error:</strong><br />
<pre><code>trait testTrait {
    public $demo = 'test';
}

class testClass {
use testTrait;

    protected $demo = 'test';

    /* ... */
}</code></pre></p>
<p>.</p>
<p><strong>PHP Manual:</strong><br />
<a href="http://php.net/manual/en/language.oop5.traits.php" target="_blank">http://php.net/manual/en/language.oop5.traits.php</a></p></blockquote>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php&text=Weekly+PHP+Test" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php&title=Weekly+PHP+Test&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=Weekly+PHP+Test&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/01/weekly-php-test-4.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fweekly-php-test-4.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/01/weekly-php-test-4.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>smrtClass</title>
		<link>http://www.mikestowe.com/2012/01/smrtclass-2.php</link>
		<comments>http://www.mikestowe.com/2012/01/smrtclass-2.php#comments</comments>
		<pubDate>Sat, 14 Jan 2012 21:37:53 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[smrtClass]]></category>

		<guid isPermaLink="false">http://www.mikestowe.com/?p=806</guid>
		<description><![CDATA[smrtClass is a restrictive data type class based on PHP&#8217;s stdClass. Instead of allowing the free creation and setting of properties as the stdClass does, smrtClass requires properties to be setup first with a specific type or regex requirement. Data is then checked against this requirement when the property is modified, and if inconsistent with [...]]]></description>
			<content:encoded><![CDATA[<p>smrtClass is a restrictive data type class based on PHP&#8217;s stdClass.  Instead of allowing the free creation and setting of properties as the stdClass does, smrtClass requires properties to be setup first with a specific type or regex requirement.  Data is then checked against this requirement when the property is modified, and if inconsistent with the data requirements throws an exception.</p>
<p>smrtClass is designed to provide an added layer of security to PHP applications, and while it does not provide 100% protection, it does signigicantly help to prevent malicious, dangerous, or malformed data from making its way into the applications crucial systems.</p>
<p>smrtClass also contains locking mechanisms to prevent data from being deliberately or accidentally modified.</p>
<h3>CLASS METHODS</h3>
<p>&nbsp;<br />
<strong>== smrtClass::add ==</strong><br />
smrtClass::add( $var_name, $var_type = ['string'|'int'|'bool'|'object'|'array',|'date'|'datetime'|'timestamp'|'email'|'url'], $value = null );<br />
<pre><code>$test = new smrtClass();
$test-&gt;add('number', 'int');
$test-&gt;number = '10'; // converted to integer
echo gettype($test-&gt;number): // displays &quot;integer&quot;

$test-&gt;add('string');
$test-&gt;string = 'Hello World'; // set as a string

$test-&gt;add('emailAddress', 'email');
$test-&gt;emailAddress = 'test@test.com'; // validated to be an email and set as string</code></pre></p>
<p><strong>== smrtClass::addRegex ==</strong><br />
smrtClass::addRegex( $var_name, $regex, $value = null );<br />
<pre><code>$test = new smrtClass();
$test-&gt;addRegex('numberOnly', '/^[0-9]+$/');
$test-&gt;numberOnly = 10; // valid
$test-&gt;numberOnly = 'ten'; // throws exception

$test-&gt;add('alphaOnly', '/^[a-z]$/i');
$test-&gt;alphaOnly = 'Hello'; // valid
$test-&gt;alphaOnly = 'Hello world'; // throws an exception because of the space</code></pre></p>
<p><strong>== smrtClass::set ==</strong><br />
smrtClass:set( $var_name, $value )<br />
<pre><code>$test = new smrtClass();
$test-&gt;add('name');
$test-&gt;set('name', 'Michael');
$test-&gt;name = 'Michael'; // does the same thing as set</code></pre></p>
<p><strong>== smrtClass::remove ==</strong><br />
smrtClass:remove( $var_name )<br />
<pre><code>$test = new smrtClass();
$test-&gt;add('name');
$test-&gt;name = 'Michael';
$test-&gt;remove('name'); // removes the name property
unset($test-&gt;name); // does the same thing as remove</code></pre></p>
<p><strong>== smrtClass::listTypes ==</strong><br />
smrtClass::listTypes()</p>
<p>returns an array of supported types such as string, int, bool, etc.</p>
<p><pre><code>$test = new smrtClass();
$test-&gt;listTypes();</code></pre></p>
<p><strong><br />
Installing smrtClass</strong><br />
smrtClass can be run on any server utilizing PHP 5.3</p>
<p><strong>Coding Restrictions<br />
</strong></p>
<ol>
<li>smrtClass is limited to the same property naming restrictions as stdClass</li>
<li>smrtClass currently does not allow for data types to be changed</li>
</ol>
<p><strong> </strong></p>
<p><strong>Bugs</strong></p>
<ul>
<li>No known errors</li>
</ul>
<p><strong><br />
Awards (Yay)</strong> <em>- listed in the order received</em><br />
We&#8217;re working on this&#8230; lol</p>
<p><strong>Usage</strong><br />
smrtClass was released under the <a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GPL version 2 license</a>. </p>
<p><strong> </strong></p>
<p><strong>Download<br />
</strong></p>
<p><center><a href="http://www.phpclasses.org/smrtClass" target="_blank"><div style="width: 476px; height: 35px; background: #E6E6FF url(http://www.mikestowe.com/wp-content/uploads/2010/10/phpclasses.gif) no-repeat 0px 5px; border: 1px solid #CCC; color: #333; font-weight: normal; text-decoration: none; margin: -10px 0px 20px 0px; text-align: left; padding: 12px 0px 0px 125px;"><span style="font-weight: bold; font-size: 12px; color: #022741;">http://www.phpclasses.org/smrtClass</span></div></a></center></p>
<div class="trackable_sharing"><a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php" style="text-decoration: none; white-space: nowrap;" title="Facebook" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Facebook','http://www.mikestowe.com/2012/01/smrtclass-2.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//facebook.png" alt="Facebook" width="20.8" height="20.8"></a> <a href="http://twitter.com/share?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php&text=smrtClass" style="text-decoration: none; white-space: nowrap;" title="Twitter" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Twitter','http://www.mikestowe.com/2012/01/smrtclass-2.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//twitter.png" alt="Twitter" width="20.8" height="20.8"></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php&ro=false&summary=&source=" style="text-decoration: none; white-space: nowrap;" title="Linkedin" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Linkedin','http://www.mikestowe.com/2012/01/smrtclass-2.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=350'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//linkedin.png" alt="Linkedin" width="20.8" height="20.8"></a> <a href="http://digg.com/submit?partner=addthis&url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php&title=smrtClass&bodytext=" style="text-decoration: none; white-space: nowrap;" title="Digg" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Digg','http://www.mikestowe.com/2012/01/smrtclass-2.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//digg.png" alt="Digg" width="20.8" height="20.8"></a> <a href="http://www.reddit.com/login?dest=%2Fsubmit%3Furl=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php" style="text-decoration: none; white-space: nowrap;" title="Reddit" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Reddit','http://www.mikestowe.com/2012/01/smrtclass-2.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=700,height=500'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//reddit.png" alt="Reddit" width="20.8" height="20.8"></a> <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php&title=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php" style="text-decoration: none; white-space: nowrap;" title="Stumbleupon" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Stumbleupon','http://www.mikestowe.com/2012/01/smrtclass-2.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=750,height=450'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//stumbleupon.png" alt="Stumbleupon" width="20.8" height="20.8"></a> <a href="http://www.tumblr.com/login?s=&t=smrtClass&u=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php&v=3&o=0" style="text-decoration: none; white-space: nowrap;" title="Tumblr" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Tumblr','http://www.mikestowe.com/2012/01/smrtclass-2.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=500,height=400'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//tumblr.png" alt="Tumblr" width="20.8" height="20.8"></a> <a href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php" style="text-decoration: none; white-space: nowrap;" title="Posterous" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Posterous','http://www.mikestowe.com/2012/01/smrtclass-2.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=900,height=600'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//posterous.png" alt="Posterous" width="20.8" height="20.8"></a> <a href="mailto:?subject=Check out http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php" style="text-decoration: none; white-space: nowrap;" title="Email" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Email','http://www.mikestowe.com/2012/01/smrtclass-2.php']); "><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//email.png" alt="Email" width="20.8" height="20.8"></a> <a href="http://www.ecreativeim.com/snailmail.php" style="text-decoration: none; white-space: nowrap;" title="Snailmail" target="_blank" onclick="that=this;_gaq.push(['_trackEvent','SocialSharing','Snailmail','http://www.mikestowe.com/2012/01/smrtclass-2.php']); _trackableshare_window = window.open(this.href,'share','menubar=0,resizable=1,width=310,height=310'); _trackableshare_window.focus(); return false;"><img align="absmiddle" src="http://www.mikestowe.com/wp-content/plugins/trackable-social-share-icons/buttons/f4//snailmail.png" alt="Snailmail" width="20.8" height="20.8"></a> <br /><div style="padding: 5px 0 5px 0;"><fb:like href="http%3A%2F%2Fwww.mikestowe.com%2F2012%2F01%2Fsmrtclass-2.php" send="true" width="450" show_faces="false" font=""></fb:like></div></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mikestowe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mikestowe.com/2012/01/smrtclass-2.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

