<?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>Blogternals &#187; code</title>
	<atom:link href="http://www.blogternals.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blogternals.com</link>
	<description>Knowledge Belongs to the World!</description>
	<lastBuildDate>Wed, 11 Aug 2010 12:32:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>The Basics of Working With PHP Arrays</title>
		<link>http://www.blogternals.com/2009/06/04/the-basics-of-working-with-php-arrays/</link>
		<comments>http://www.blogternals.com/2009/06/04/the-basics-of-working-with-php-arrays/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 16:33:18 +0000</pubDate>
		<dc:creator>Allen Sanford</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.blogternals.com/?p=594</guid>
		<description><![CDATA[An array in PHP is simply a variable that is used to store data. Most of the time this data has some sort of common denominator. You will see a lot of code storing things like table row data in arrays. Using arrays also allows you do do some neat things that would be other [...]]]></description>
			<content:encoded><![CDATA[<p>An array in PHP is simply a variable that is used to store data. Most of the time this data has some sort of common denominator. You will see a lot of code storing things like table row data in arrays. Using arrays also allows you do do some neat things that would be other wise difficult like sorting data and comparing data.</p>
<p>Before you can use an array in PHP you have create a variable and declare it as an array. Now there are actually several ways to accomplish this som let me drop an example in right here.</p>
<p><span id="more-594"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.blogternals.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=594&amp;download=example.php">example.php</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5943"><td class="line_numbers"><pre>22
23
24
25
26
27
28
29
30
</pre></td><td class="code" id="p594code3"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">//...</span>
    <span style="color: #000088;">$array1</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$array2</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Allen&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Sanford&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$array3</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;firstname&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Allen&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;id&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">423567123</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$array4</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Allen&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// This is a multi-dimensional array example</span>
    <span style="color: #000088;">$array4</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'lastname'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Sanford&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// This is a multi-dimensional array example</span>
    <span style="color: #000088;">$array4</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;John&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// This is a multi-dimensional array example</span>
    <span style="color: #000088;">$array4</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'lastname'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Doe&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// This is a multi-dimensional array example</span>
    <span style="color: #666666; font-style: italic;">//...</span></pre></td></tr></table></div>

<p>And some of you may be asking can you mix and match those, and the answer is yes you can mix and match those examples. Also it is important to note that unlike some languages PHP will allow you to store different data types in a single array. You can also store other arrays in a single array letting you do all the cool multi-dimensional array stuff. Arrays in PHP can have both numeric indexes or string indexes (which are called associative arrays), however they can not be mixed. </p>
<p>Now that you have defined an array you will need to be able to use the information contained in the array(s). For this again you have several options so I will drop another example to show you how you could display the information contained in your array.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.blogternals.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=594&amp;download=example">example</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5944"><td class="line_numbers"><pre>32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code" id="p594code4"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">//...</span>
    <span style="color: #666666; font-style: italic;">// Using the data set form the previous example</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$array2</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Allen</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$array4</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Doe</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$array3</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; = &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$value</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// last line will output: id = 423567123</span>
&nbsp;
     <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$array4</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$tempArray</span><span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$tempArray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// You should get the picture by now</span>
    <span style="color: #666666; font-style: italic;">//...</span></pre></td></tr></table></div>

<p> This should get you started working with PHP arrays. There are many advanced concepts that I am going to cover in future articles release here on Blogternals. I will be covering Iterators, Hashes, and tree implementations as well as some not so intuitive but useful uses for arrays in PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blogternals.com/2009/06/04/the-basics-of-working-with-php-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a Comment to a PHP Code Page</title>
		<link>http://www.blogternals.com/2009/06/04/adding-a-comment-to-a-php-code-page/</link>
		<comments>http://www.blogternals.com/2009/06/04/adding-a-comment-to-a-php-code-page/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 12:24:17 +0000</pubDate>
		<dc:creator>Allen Sanford</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.blogternals.com/?p=574</guid>
		<description><![CDATA[Comments are actually the most important thing any coder can learn to properly use. There are actually a few different styles to use when commenting code for PHP. In this tutorial I am mostly going to let the code do the speaking &#8230; so to speak &#8230;?! Any way. Let me get a few important [...]]]></description>
			<content:encoded><![CDATA[<p>Comments are actually the most important thing any coder can learn to properly use. There are actually a few different styles to use when commenting code for PHP. In this tutorial I am mostly going to let the code do the speaking &#8230; so to speak &#8230;?! Any way. Let me get a few important things out of they way first. The PHP interpreter ignores comments so you can only gain an advantage by adding then. Six months or a year down the road their usefulness out weights the trouble of adding them to your code. And lastly you can put your contact information in the comments of your code so when you pass you code out as open source somebody will notice that you wrote it. OH yeah I forgot to mention you can use them to debug code as well.</p>
<p><span id="more-574"></span></p>
<p>First style that you will see is in line or single line comments and they can be used two ways.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.blogternals.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=574&amp;download=example.php">example.php</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5748"><td class="line_numbers"><pre>42
43
44
45
46
</pre></td><td class="code" id="p574code8"><pre class="php" style="font-family:monospace;">&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rows</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// This loops through every row of rows</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// TODO: Implement something cool here</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Second style is to use multi-line comments, this is used by the famous phpDocumentor project.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.blogternals.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=574&amp;download=example.php">example.php</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5749"><td class="line_numbers"><pre>42
43
44
45
46
47
48
49
50
51
52
53
</pre></td><td class="code" id="p574code9"><pre class="php" style="font-family:monospace;">&nbsp;
    <span style="color: #666666; font-style: italic;">/*
        I know that I want to implement this loop later
        but I don't want to run a loop that does nothing
        either so for know I am going to comment out
        all of this.
        Cool!
        foreach ($rows as $row)
        {
            // TODO: Implement something cool here
        }
    */</span></pre></td></tr></table></div>

<p>Third style is the less familiar but oh so useful if stament comment. Allowing you to wrap large blocks of code with an if statement to comment it out.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.blogternals.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=574&amp;download=example.php">example.php</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p57410"><td class="line_numbers"><pre>42
43
44
45
46
47
48
49
</pre></td><td class="code" id="p574code10"><pre class="php" style="font-family:monospace;">&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// This will skip this block of code thereby not executing a loop that does nothing</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rows</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// TODO: Implement something cool here</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// End if (0)</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.blogternals.com/2009/06/04/adding-a-comment-to-a-php-code-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting PHP Code Into a Web Page</title>
		<link>http://www.blogternals.com/2009/06/03/inserting-php-code-into-a-web-page/</link>
		<comments>http://www.blogternals.com/2009/06/03/inserting-php-code-into-a-web-page/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 08:45:59 +0000</pubDate>
		<dc:creator>Allen Sanford</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.blogternals.com/?p=561</guid>
		<description><![CDATA[Most beginners in PHP are under the assumption that only PHP code can be placed in .php files. This is an incorrect assumption. Today I am going to show how to insert PHP code into HTML markup and place all of it in a .php file. Inserting PHP code into HTML markup allows us to [...]]]></description>
			<content:encoded><![CDATA[<p>Most beginners in PHP are under the assumption that only PHP code can be placed in <strong>.php </strong>files. This is an incorrect assumption. Today I am going to show how to insert PHP code into HTML markup and place all of it in a <strong>.php</strong> file.</p>
<p>Inserting PHP code into HTML markup allows us to create interactive, dynamic, pages for our website. In order to achieve this we simply place any HTML markup that is static out side the <em>and<em> </em></em>?> , the opening and closing delimiters for PHP code. Also note that we can place multiple PHP code sections in our HTML markup by using different instances of the PHP delimiters.</p>
<p><span id="more-561"></span></p>
<p>When the web server receives a request from the web to display our <strong>.php</strong> file the PHP interpreter will parse all of the code between the delimiters   as PHP code. The PHP interpreter will then return the output of this PHP code to the web server to be inserted into the web page just before it is passed to the requesting browser. The users who are viewing this web page will not be able to see the PHP code, they will only be able to see the resulting output from the PHP code that has been executed on the server.</p>
<p><br class="spacer_" /></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.blogternals.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=561&amp;download=example.php">example.php</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56112"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p561code12"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!</span>DOCTYPE HTML <span style="color: #000000; font-weight: bold;">PUBLIC</span> <span style="color: #0000ff;">&quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;</span>
                                   <span style="color: #0000ff;">&quot;http://www.w3.org/TR/html4/loose.dtd&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>PHP Example<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>Example PHP<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Hello World&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    <span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p><br class="spacer_" /></p>
<p>When you get ready to save the PHP files you have created you have to save them with a <strong>.php</strong> extension, however some text editors do not recognize the <strong>.php</strong> extension, so you may have to enclose the filename in quotation marks like so, &#8220;example.php&#8221;. It may be possible that your PHP configuration is configured to parse other file extensions as PHP such as .phtml, .html or .htm, but in any case if your server is configured to parse a certain extension then you are allowed to place PHP code into files with those extensions configured.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blogternals.com/2009/06/03/inserting-php-code-into-a-web-page/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; A Simple Start</title>
		<link>http://www.blogternals.com/2009/05/19/php-a-simple-start/</link>
		<comments>http://www.blogternals.com/2009/05/19/php-a-simple-start/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:17:06 +0000</pubDate>
		<dc:creator>Allen Sanford</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hello world]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[start]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.blogternals.com/?p=362</guid>
		<description><![CDATA[First I would like to say that this article makes the assumption you already have a working PHP installation. If not go here first. Alrighty then , now most tutorials will have you do the classic &#8220;Hello World!&#8221; as is customary in almost every programming language tutorial in existence, so I shall not disappoint. In [...]]]></description>
			<content:encoded><![CDATA[<p>First I would like to say that this article makes the assumption you already have a working PHP installation. If not go <a href="http://us.php.net/manual/en/install.php">here</a> first.</p>
<p>Alrighty then , now most tutorials will have you do the classic &#8220;Hello World!&#8221; as is customary in almost every programming language tutorial in existence, so I shall not disappoint. In your (DOCUMENT ROOT for our purposes we will use http://www.example.com) create a file named hello.php  and place the following in it:</p>
<p><span id="more-362"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.blogternals.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=362&amp;download=hello.php">hello.php</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36215"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p362code15"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!</span>DOCTYPE HTML <span style="color: #000000; font-weight: bold;">PUBLIC</span> <span style="color: #0000ff;">&quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;</span>
                                   <span style="color: #0000ff;">&quot;http://www.w3.org/TR/html4/loose.dtd&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>PHP Test<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Hello World&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    <span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>After you copy the above file to your DOCUMENT ROOT you should be able to navigate to http://www.example.com/hello.php and your page should simple display Hello World! If you tried this example and it did not output jus the text &#8220;Hello Wolrd!&#8221;, it prompted you for a download, or you see the whole file as text, chances are that the server you are on does not have PHP enabled, or is PHP is not properly configured. You should contact your system admin your further help. It you did however get the proper output congratulations you just successfully wrote and executed your first PHP Program.</p>
<p>Now that you have created your first PHP scritp (I should really be calling these scripts as that is what they are) I am going to show you the most useful and shortest PHP script you can write. Ready don&#8217;t blink or you&#8217;ll miss it. HaHa I know it is written on a web page so how could you miss it you could just re-read it. Anyway here you go. We will call it phpinfo.php</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.blogternals.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=362&amp;download=phpinfo.php">phpinfo.php</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36216"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p362code16"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Making a call to the phpinfo() function will show a lot of useful information about your system and setup such as available predefined variables, loaded PHP modules, and configuration settings. I would take a few minutes and familiarize yourself with it and all the information in it.</p>
<p>Well I promised I simple start and I believe I have delivered just that. What do you think? Any suggestions are welcome and all questions will be answered so feel free to ask away leave a comment and get your questions answered.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blogternals.com/2009/05/19/php-a-simple-start/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML and CSS conditional statements</title>
		<link>http://www.blogternals.com/2008/06/13/html-and-css-conditional-statements/</link>
		<comments>http://www.blogternals.com/2008/06/13/html-and-css-conditional-statements/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 17:39:10 +0000</pubDate>
		<dc:creator>Allen Sanford</dc:creator>
				<category><![CDATA["Left Overs"]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conditionals]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.blogternals.com/?p=17</guid>
		<description><![CDATA[Finding a good tutorial on how to use HTML and CSS conditionals is tough. There are plenty out there but none of them really go in depth on the subject. I have put together what I hope is a complete or almost complete and easy to under stand How-to on the subject of HTML and CSS conditionals.]]></description>
			<content:encoded><![CDATA[<p>Finding a good tutorial on how to use HTML and CSS conditionals is tough. There are plenty out there but none of them really go in depth on the subject. I have put together what I hope is a complete or almost complete and easy to under stand How-to on the subject of HTML and CSS conditionals.<br />
 <span id="more-17"></span><br />
 Let me take a moment here and say that there is not whole lot to conditional HTML and CSS statements, but they can save you a lot of time when used right.</p>
<p>First we will uncover the simple and most used conditionals, IE specific conditionals.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p17code17'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1717"><td class="code" id="p17code17"><pre class="html" style="font-family:monospace;">    &lt;!--[if IE]&gt;
        You are using Internet Explorer or IE as it is called sometimes
    &lt;![endif]--&gt;
&nbsp;
    &lt;!--[if IE 5]&gt;
        IE Version 5
    &lt;![endif]--&gt;
&nbsp;
    &lt;!--[if IE 5.0]&gt;
        IE Version 5.0
    &lt;![endif]--&gt;
&nbsp;
    &lt;!--[if IE 5.5]&gt;
        IE Version 5.5
    &lt;![endif]--&gt;
&nbsp;
    &lt;!--[if IE 6]&gt;
        IE Version 6
    &lt;![endif]--&gt;
&nbsp;
    &lt;!--[if IE 7]&gt;
        IE Version 7
    &lt;![endif]--&gt;</pre></td></tr></table></div>

<p>Occasionally you may have the need to target non-IE browsers, does not make a whole lot of sense to me but some people may have a need for it. I have even used once or twice by necessity but any way here you go.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p17code18'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1718"><td class="code" id="p17code18"><pre class="html" style="font-family:monospace;">    &lt;!--[if !IE]&gt;&lt;!--&gt;
        You are NOT using Internet Explorer
    &lt;!--&lt;![endif]--&gt;</pre></td></tr></table></div>

<p>Finally for the occasion when you need to target non-IE and a specific IE browser, or any other combination using lte lt or gt gte.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p17code19'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1719"><td class="code" id="p17code19"><pre class="html" style="font-family:monospace;">    &lt;!--[if IE 6]&gt;&lt;!--&gt;
           Internet Explorer version 6
           OR
    &lt;!--&lt;![endif]--&gt;
&nbsp;
    You are using
    &lt;!--[if IE 6]&gt;
        IE6 and not
    &lt;!--&gt;
        a non-IE browser
     &lt;!--&lt;![endif]--&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.blogternals.com/2008/06/13/html-and-css-conditional-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
