<?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>PHP Programming 101</title>
	<atom:link href="http://phpprogramming101.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpprogramming101.com</link>
	<description>Your basic PHP tutorial site.</description>
	<lastBuildDate>Tue, 10 Aug 2010 11:14:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Array Chunk Function</title>
		<link>http://phpprogramming101.com/basic-programming/array-chunk-function/</link>
		<comments>http://phpprogramming101.com/basic-programming/array-chunk-function/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 11:14:57 +0000</pubDate>
		<dc:creator>Conrad</dc:creator>
				<category><![CDATA[Basic Programming]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[Array manipulation]]></category>
		<category><![CDATA[Programming PHP]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/uncategorized/array-chunk-function/</guid>
		<description><![CDATA[
The array_chunk() function on the on the other hand as the name implies, divides an array into chunks or several tables from the source table. The syntax goes something like array_chunk(array,size,preserve_key), wherein the array is the table that would be divided, the size is the number of elements which the new arrays are to contain [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://smallcode.weblogs.us/2006/07/"><img src="/wp-content/uploads/scraped/20.jpg"/></a>
<p>The array_chunk() function on the on the other hand as the name implies, divides an array into chunks or several tables from the source table. The syntax goes something like array_chunk(array,size,preserve_key), wherein the array is the table that would be divided, the size is the number of elements which the new arrays are to contain and the preserve key which can either be true or false is used to either retain or revise the key or pointer value of the original table. An example is shown below:</p>
<p><?php<br />
$a=array(�a�=>�Cat�, �b�=>�Dog�, �c�=>�Horse�,�d�=>�Cow�);<br />
print_r(array_chunk($a,2);<br />
?></p>
<p>The code would have an output of:</p>
<p>Array (<br />
[0] => Array ( [0] = > Cat    [1] => Dog )<br />
[1] => Array ( [0] => Horse [1] => Cow )<br />
)</p>
<p>As we can see, the original array has been divided into two arrays array0 and array1 and a value that is not given for the key had it assigned a new key for each of the tables. Another example would be :</p>
<p><?php<br />
$a=array(�a�=>�Cat�, �b�=>�Dog�, �c�=>�Horse�,�d�=>�Cow�);<br />
print_r(array_chunk($a,2,true);<br />
?></p>
<p>This would then give us ;<br />
Array (<br />
[0] => Array ( [a] = > Cat    [b] => Dog )<br />
[1] => Array ( [c] => Horse [d] => Cow )<br />
)</p>
<p>This shows the significance of the retain key field wherein the two new arrays retained their original keys. The reverse of which would be the array_combine() which divided the array into one which holds the keys and one with the values.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/basic-programming/array-chunk-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading the current time: time() and microtime()</title>
		<link>http://phpprogramming101.com/php/reading-the-current-time-time-and-microtime/</link>
		<comments>http://phpprogramming101.com/php/reading-the-current-time-time-and-microtime/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 14:09:17 +0000</pubDate>
		<dc:creator>Conrad</dc:creator>
				<category><![CDATA[Basic Programming]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/php/reading-the-current-time-time-and-microtime/</guid>
		<description><![CDATA[


int time ( )
mixed microtime ( [bool get_as_float])

PHP has a basic function to get the current time in epoch format: time(). Time() takes no parameters, and returns the current timestamp representing the current time. As time() is the first function we have looked at, here is an example script: 


 
As you can see, we [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bugfoo.com/docs/toolbars/benchmark/"><img src="/wp-content/uploads/scraped/33.jpg"/></a>
<p>
<code><br />
int time ( )<br />
mixed microtime ( [bool get_as_float])<br />
</code></p>
<p>PHP has a basic function to get the current time in epoch format: time(). Time() takes no parameters, and returns the current timestamp representing the current time. As time() is the first function we have looked at, here is an example script: </p>
<p><code><br />
<?php<br />
    print time();<br />
    $foo = time();<br />
    print $foo;<br />
?><br />
</code> </p>
<p>As you can see, we can either print the return value of time() directly, or we can store it away in a variable then print the contents of the variable &#8211; the result is identical.</p>
<p>Working in Unix time means you are not tied down to any specific formatting &#8211; you do not need to worry about whether your date has months before days or vice versa, whether long months are used, whether day numbers of day words (Saturday, Tuesday, etc) are used, and so on.</p>
<p>Furthermore, to add one to a day (that is, to get the date of tomorrow), you can just add one day&#8217;s worth of seconds to your current timestamp: 60 x 60 x 24 = 86400. So, adding or subtracting 86400 to a date moves forward by one day, and so on &#8211; easy, really.</p>
<p>For more precise time values, you can use the microtime() function. When called without any parameters, this returns the current system time in seconds and microseconds, ordered microseconds first. For example: 0.82112000 1174676574</p>
<p>If you pass true to microtime() as its only parameter, PHP will return the time in a more obvious format &#8211; seconds.microseconds, like this: 1174676587.5996</p>
<p>When using microtime(), keep in mind that the return value is a floating-point number. There is a setting in your php.ini file called &#8220;precision&#8221;, which sets the number of significant digits to show in floating-point numbers &#8211; note that is significant digits, not decimal places, which means your return value from microtime() may not be as precise as you want. Above, for example, you can see we only have four decimal places returned &#8211; this is because php.ini defaults precision to 14, and there are ten digits before the decimal place.</p>
<p>If you increase the value of precision up to, say, 18, and run microtime() again, you will get results that are more accurate: 1174677004.8997819. </p>
<p><a href="http://www.hudzilla.org/php/4_5_1.php">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/php/reading-the-current-time-time-and-microtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arrays : Changing cases</title>
		<link>http://phpprogramming101.com/basic-programming/arrays-%e2%80%93-changing-cases/</link>
		<comments>http://phpprogramming101.com/basic-programming/arrays-%e2%80%93-changing-cases/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 11:13:56 +0000</pubDate>
		<dc:creator>Conrad</dc:creator>
				<category><![CDATA[Basic Programming]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[Array manipulation]]></category>
		<category><![CDATA[Programming PHP]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/uncategorized/arrays-%e2%80%93-changing-cases/</guid>
		<description><![CDATA[
This form of array declaration allows one to change the case from uppercase to lowercase and vice versa. The syntax goes as follows:
array_change_key_case(array,case)
The array part, specifies which table or array to use and is a required field which is not the case with the key which is automatically assigned a value. An example of it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://askbobrankin.com/what_is_raid.html"><img src="/wp-content/uploads/scraped/19.jpg"/></a>
<p>This form of array declaration allows one to change the case from uppercase to lowercase and vice versa. The syntax goes as follows:</p>
<p>array_change_key_case(array,case)</p>
<p>The array part, specifies which table or array to use and is a required field which is not the case with the key which is automatically assigned a value. An example of it&#8217;s use can be seen below:</p>
<p><?php<br />
$a=array('a'=>&#8220;Mouse&#8221;,&#8217;b'=>&#8221;Rat&#8221;,&#8217;c'=>&#8221;Rodent&#8221;,&#8217;d'=>&#8221;Cat&#8221;);<br />
print_r(array_change_key_case($a,CASE_UPPER));<br />
?></p>
<p>The output of the said commands will be:<br />
Array ( [A] => Mouse [B] => Rat [C] => Rodent [D] => Cat)</p>
<p>Another example of it&#8217;s use would be:</p>
<p><?php<br />
$a=array('a'=>&#8220;Mouse&#8221;,&#8217;B'=>&#8221;Rat&#8221;,&#8217;c'=>&#8221;Rodent&#8221;,&#8217;b'=>&#8221;Cat&#8221;);<br />
print_r(array_change_key_case($a,CASE_UPPER));<br />
?></p>
<p>That returns the following values respectively:<br />
Array ( [A] => Mouse [B] => Rat [C] => Rodent [D] => Cat)</p>
<p>In the next post, we would discuss an array function that divides a large array into several chunks of separate arrays.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/basic-programming/arrays-%e2%80%93-changing-cases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Programming Basics</title>
		<link>http://phpprogramming101.com/basic-programming/more-programming-basics/</link>
		<comments>http://phpprogramming101.com/basic-programming/more-programming-basics/#comments</comments>
		<pubDate>Mon, 10 May 2010 14:39:09 +0000</pubDate>
		<dc:creator>Conrad</dc:creator>
				<category><![CDATA[Basic Programming]]></category>
		<category><![CDATA[Data Types]]></category>
		<category><![CDATA[Variables]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/uncategorized/more-programming-basics/</guid>
		<description><![CDATA[
As with all programming languages PHP has different variable types such as numeric, character, string and Boolean types. Boolean variables in PHP always return either true or false, integers are whole numbers, floating points are decimal or scientifically notated and strings are a chain of characters. Sounds familiar, well they are and they are mostly [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.stanford.edu/dept/itss/docs/oracle/10g/appdev.101/b10779/oci02bas.htm"><img src="/wp-content/uploads/scraped/17.jpg"/></a>
<p>As with all programming languages PHP has different variable types such as numeric, character, string and Boolean types. Boolean variables in PHP always return either true or false, integers are whole numbers, floating points are decimal or scientifically notated and strings are a chain of characters. Sounds familiar, well they are and they are mostly standard across the various programming languages. For a more in-depth discussion on the different data types of PHP go visit the <strong><a href="http://www.php.net/manual/en/language.types.php">manual page</a></strong>.<br />
We next discuss operators such as the assignment operator which allows you to assign values to variables allowing complex operations to be constructed into more and more functional programs.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/basic-programming/more-programming-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP and other Programming Languages</title>
		<link>http://phpprogramming101.com/basic-programming/php-and-other-programming-languages/</link>
		<comments>http://phpprogramming101.com/basic-programming/php-and-other-programming-languages/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 14:38:06 +0000</pubDate>
		<dc:creator>Conrad</dc:creator>
				<category><![CDATA[Basic Programming]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Operators]]></category>
		<category><![CDATA[Variables]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/uncategorized/php-and-other-programming-languages/</guid>
		<description><![CDATA[
The major notable difference with PHP against other languages with regards to variables is that PHP is more &#8220;intelligent&#8221;. In C for example, variables have to be explicitly defined as either numeric or alpha-numeric and can only be used to store that defined specific form of data. PHP like all other languages supports a lot [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://news.cnet.com/8301-13505_3-10009669-16.html"><img src="/wp-content/uploads/scraped/16.jpg"/></a>
<p>The major notable difference with PHP against other languages with regards to variables is that PHP is more &#8220;intelligent&#8221;. In C for example, variables have to be explicitly defined as either numeric or alpha-numeric and can only be used to store that defined specific form of data. PHP like all other languages supports a lot of variable types such as integers, floating point numbers, arrays and strings but with one major difference, variables are recognized automatically based on their use and the context of their use. This makes your (programmer&#8217;s) life a whole lot easier. PHP variables are defined with a &#8220;$&#8221; symbol preceding the variable name. It should also begin with either an underscore or an alpha character.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/basic-programming/php-and-other-programming-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding Comments</title>
		<link>http://phpprogramming101.com/basic-programming/embedding-comments/</link>
		<comments>http://phpprogramming101.com/basic-programming/embedding-comments/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 14:38:06 +0000</pubDate>
		<dc:creator>Conrad</dc:creator>
				<category><![CDATA[Basic Programming]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[Basic PHP]]></category>
		<category><![CDATA[Comments]]></category>
		<category><![CDATA[Sample]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/uncategorized/embedding-comments/</guid>
		<description><![CDATA[
Now, to make you a better programmer we all know the value of comments. This allows you to understand the code that you have written defining and given meaning to operations as you build them up. You start with the terminators used by PHP and end with them as well. Single line comments look like [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.digitalalchemy.tv/2007/06/watch-ted-talks-technology.html"><img src="/wp-content/uploads/scraped/15.jpg"/></a>
<p>Now, to make you a better programmer we all know the value of comments. This allows you to understand the code that you have written defining and given meaning to operations as you build them up. You start with the terminators used by PHP and end with them as well. Single line comments look like this �// comment� and Multi-line ones use the syntax /* comment comment*/. A better example would be the one below:</p>
<p><?php<br />
//comment<br />
/* comment<br />
Comment*/<br />
?></p>
<p>In the next post we take on the best parts of PHP which would be variables which is essential in all programming languages.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/basic-programming/embedding-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More into the syntax of PHP</title>
		<link>http://phpprogramming101.com/basic-programming/more-into-the-syntax-of-php/</link>
		<comments>http://phpprogramming101.com/basic-programming/more-into-the-syntax-of-php/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 14:36:07 +0000</pubDate>
		<dc:creator>Conrad</dc:creator>
				<category><![CDATA[Basic Programming]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[PHP Syntax]]></category>
		<category><![CDATA[Program]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/uncategorized/more-into-the-syntax-of-php/</guid>
		<description><![CDATA[
As you might have seen, all of the PHP statement ends with &#8220;;&#8221; which would be somewhat similar to Perl. The valid HTML code that was handed back to the server was :
Sample:
html>
head>
body>
Who are You?
br />
My name is MacGyver.
/body>
/html>
(Note: opening &#8220;]]></description>
			<content:encoded><![CDATA[<p><a href="http://%25E2%259C%258E.net/category/php/"><img src="/wp-content/uploads/scraped/14.jpg"/></a>
<p>As you might have seen, all of the PHP statement ends with &#8220;;&#8221; which would be somewhat similar to Perl. The valid HTML code that was handed back to the server was :<br />
Sample:<br />
html><br />
head></head><br />
body><br />
Who are You?<br />
br /><br />
My name is MacGyver.<br />
/body><br />
/html><br />
(Note: opening &#8220;<&#8221; were removed to allow display of the code)<br />
More in the coming posts when we dig deeper as we widen our understanding of PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/basic-programming/more-into-the-syntax-of-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dissecting/Understanding the first program</title>
		<link>http://phpprogramming101.com/basic-programming/dissectingunderstanding-the-first-program/</link>
		<comments>http://phpprogramming101.com/basic-programming/dissectingunderstanding-the-first-program/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 14:35:10 +0000</pubDate>
		<dc:creator>Conrad</dc:creator>
				<category><![CDATA[Basic Programming]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Parser]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/uncategorized/dissectingunderstanding-the-first-program/</guid>
		<description><![CDATA[
The first post had you making a program that was equivalent to the &#8220;Hello World&#8221; program used for teaching basics of a programming language and here&#8217;s how it worked. When the script was requested by opening the web page, Apache intercepted the request and passed it onto PHP which parsed the script looking for the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mcleaninternational.com/testimonials"><img src="/wp-content/uploads/scraped/13.jpg"/></a>
<p>The first post had you making a program that was equivalent to the &#8220;Hello World&#8221; program used for teaching basics of a programming language and here&#8217;s how it worked. When the script was requested by opening the web page, Apache intercepted the request and passed it onto PHP which parsed the script looking for the code in between the <?PHP "?> terminators and then doing the requested operation which was to display the text contained within the echo command. This result was given back to the server then again to the client. The output contained a valid HTML so the browser was able to understand it and execute the requested operation.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/basic-programming/dissectingunderstanding-the-first-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>6 Tips For Better Form Design (3/3)</title>
		<link>http://phpprogramming101.com/php/6-tips-for-better-form-design-33/</link>
		<comments>http://phpprogramming101.com/php/6-tips-for-better-form-design-33/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 14:53:14 +0000</pubDate>
		<dc:creator>binary</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/uncategorized/6-tips-for-better-form-design-33/</guid>
		<description><![CDATA[

INFORM THE USERS ABOUT INPUT LIMITS
When your database has a field limit, situate a size limit on a text box &#8211; this stops people from entering too much text only to find out that their data has been trimmed down by your database.
KEEP FORMS SHORT
Never make forms too long and verbose- this may cause confusion [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm1.static.flickr.com/118/298380849_ca9befd889.jpg?v=0" alt="" /></p>
<p><strong><br />
INFORM THE USERS ABOUT INPUT LIMITS</strong><br />
When your database has a field limit, situate a size limit on a text box &#8211; this stops people from entering too much text only to find out that their data has been trimmed down by your database.</p>
<p><strong>KEEP FORMS SHORT</strong><br />
Never make forms too long and verbose- this may cause confusion to people and may intimidate them.</p>
<p><strong>TELL THEM WHERE THEY ARE</strong><br />
In case of splitting forms by pages, it is a good idea to let your visitors know how far they are through the process of form submission. This lets people know where they are at the process all times.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/php/6-tips-for-better-form-design-33/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>6 Tips For Better Form Design (2/3)</title>
		<link>http://phpprogramming101.com/php/6-tips-for-better-form-design-23/</link>
		<comments>http://phpprogramming101.com/php/6-tips-for-better-form-design-23/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 14:52:17 +0000</pubDate>
		<dc:creator>binary</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://phpprogramming101.com/uncategorized/6-tips-for-better-form-design-23/</guid>
		<description><![CDATA[
ERROR HANDLING
When there is an error within a field, always put a notice next to it and a message at the top indicating the user about the error &#8211; if you don&#8217;t put the message at the top, people will not notice that there is an error, and if you don&#8217;t put a notice near [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm1.static.flickr.com/37/87432201_5a48828ba6.jpg?v=0" alt="" /></p>
<p><strong>ERROR HANDLING</strong><br />
When there is an error within a field, always put a notice next to it and a message at the top indicating the user about the error &#8211; if you don&#8217;t put the message at the top, people will not notice that there is an error, and if you don&#8217;t put a notice near the problem field, people might not tell it from the others.</p>
<p><strong><br />
MARKING NECESSARY FIELDS</strong><br />
Always mark required fields &#8211; either with bold text, or, more commonly, an asterisk *.  This is to make the users aware that the essential fields must first be satisfied before proceeding to the next step.</p>
<p>To be continued…</p>
]]></content:encoded>
			<wfw:commentRss>http://phpprogramming101.com/php/6-tips-for-better-form-design-23/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
