Monday, March 31, 2008

Lesson 2 - PHP Code

If you visited the link in the last lesson you probably already know how to tell PHP code and how to comment it. Never the less, I want to make sure and go over it just so that no one is confused.

This is what PHP code looks like by itself:


PHP-Code:
...(more code)....
...(
more code)....
echo
"$$var dollars spent.";
...(
more code)....
...(
more code)....




Everything between the opening ";" tags is sent to the PHP core to be processed, then the result is sent back. and the rest of the page continues to load. Here is what PHP code might look like in an HTML file:

Code:



<?php echo $tile; ?><title> <br /></head> <br /><body> <br /><?php echo "Welcome to $sitename"; ?> <br /><p>We are committed to serving you!</p> <br /></body> <br /></html> <br /></td> </tr></tbody></table><span class="postbody"> <br /> <br />Don't worry if you don't understand it, this is just so you know what to expect. <br /> <br />Another important part of programming is to document your code. Imagine trying to find a function or variable in a 1000 line PHP document! Without any human comments in the file it could take you forever to find what you were looking for. Here are the two most common forms of placing "Human Readable" text in a program: <br /> <br /> <br /> <br /></span> <div align="center"> <div style="overflow: auto; width: 90%;"> <table align="center" border="0" cellpadding="3" cellspacing="1" width="100%"> <tbody><tr> <td colspan="1"><span class="genmed"><b>PHP-Code:</b></span></td> </tr> <tr> <!-- <td align="right" class="code" style="width: 5px; color: #dee6ec; border-right: none;">1<br/></td> --> <td id="code"><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);"></span><span style="color: rgb(255, 128, 0);">// two forward slashes tell the program to ignore what is behind them on the line. </span><span style="color: rgb(0, 0, 187);"></span></span></code></td> </tr> </tbody></table> </div> </div> <span class="postbody"> <br /> <br /> <br /></span> <div align="center"> <div style="overflow: auto; width: 90%;"> <table align="center" border="0" cellpadding="3" cellspacing="1" width="100%"> <tbody><tr> <td colspan="1"><span class="genmed"><b>PHP-Code:</b></span></td> </tr> <tr> <!-- <td align="right" class="code" style="width: 5px; color: #dee6ec; border-right: none;">1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/></td> --> <td id="code"><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);"></span><span style="color: rgb(255, 128, 0);">/* <br />This is how you "comment" multiple lines in something. <br />Everything between the opening "/*" and closing "*/</span><span style="color: rgb(221, 0, 0);">" is <br />Ignored by the program. This form is more common than the <br />"</span><span style="color: rgb(255, 128, 0);">//" (Double-backslash) because unlike the other form this <br /></span><span style="color: rgb(0, 0, 187);">one is not limited to only ONE line of text</span><span style="color: rgb(0, 119, 0);">. <br />*/ </span><span style="color: rgb(0, 0, 187);"></span></span></code></td> </tr> </tbody></table> </div> </div> <span class="postbody"> <br /> <br />The text in both of these "comments" is ignored by PHP. Here is an example of using them in a script: <br /> <br /> <br /> <br /></span> <div align="center"> <div style="overflow: auto; width: 90%;"> <table align="center" border="0" cellpadding="3" cellspacing="1" width="100%"> <tbody><tr> <td colspan="1"><span class="genmed"><b>PHP-Code:</b></span></td> </tr> <tr> <!-- <td align="right" class="code" style="width: 5px; color: #dee6ec; border-right: none;">1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/>8<br/>9<br/></td> --> <td id="code"><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);"></span><span style="color: rgb(255, 128, 0);">/* CONFIGURATION of connect to DATABASE SECTION*/ <br /></span><span style="color: rgb(0, 0, 187);">$servername</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(221, 0, 0);">'localhost' </span><span style="color: rgb(0, 119, 0);">; </span><span style="color: rgb(255, 128, 0);">// Replace 'localhost' with your server name <br /></span><span style="color: rgb(0, 0, 187);">$database_username</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(221, 0, 0);">'root'</span><span style="color: rgb(0, 119, 0);">; </span><span style="color: rgb(255, 128, 0);">// Replace 'root' with your username <br /></span><span style="color: rgb(0, 0, 187);">$database_password</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(221, 0, 0);">'password'</span><span style="color: rgb(0, 119, 0);">; </span><span style="color: rgb(255, 128, 0);">// Replace 'password' with your password <br /></span><span style="color: rgb(0, 0, 187);">$database_name</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(221, 0, 0);">'database_1'</span><span style="color: rgb(0, 119, 0);">; </span><span style="color: rgb(255, 128, 0);">// Replace 'database_1' with your database name <br /> <br />/* take all of the values and connect to the database */ <br /></span><span style="color: rgb(0, 0, 187);">mysql_connect</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$servername</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$database_username</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$database_password</span><span style="color: rgb(0, 119, 0);">); <br /></span><span style="color: rgb(0, 0, 187);">mysql_select_db</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$database_name</span><span style="color: rgb(0, 119, 0);">); </span><span style="color: rgb(0, 0, 187);"></span></span></code></td> </tr> </tbody></table> </div> </div> <span class="postbody"> <br /> <br /> <br /> <br />See how the comments help to describe what to do here? While you probably don't know what these functions are; you can get a general idea of what this script does thanks to comments in the code. <br /> <br /> <br /> <br />One thing you need to understand before we go any further is the concept of "variables". (If you are a programmer you probably already have a knowledge of variables. Therefore you are welcome to skip this intro.) <br /> <br /><a href="http://en.wikipedia.org/wiki/Variable" target="_blank" class="postlink">Wikipedia.org</a> describes a variable as: "...a place to store a value in computer memory." A variable is stored in a "byte" (or collection of bytes) in the computers memory. Variables store some value like a phone number or age in the bytes. Most computers now-a-day have about 256MB (Mega-bytes of memory) which is 256,000,000 bytes (Mega means "million"). <br /> <br />If I have lost you I apologize. Maybe you can understand variables better if I relate them to P.O. Boxes at the post office. There are many different P.O. boxes (Think "variables")in your post office. At any time they could be used to store many different pieces of information - your paycheck, a letter from grandma, a warrant of arrest for that guy down the street...ANYTHING. Therefore they are like variables, they store different pieces of information and what they hold can change from day to day. <br />Here is what a variable in PHP looks like: <br />Example: <br /> <br /> <br /></span> <div align="center"> <div style="overflow: auto; width: 90%;"> <table align="center" border="0" cellpadding="3" cellspacing="1" width="100%"> <tbody><tr> <td colspan="1"><span class="genmed"><b>PHP-Code:</b></span></td> </tr> <tr> <!-- <td align="right" class="code" style="width: 5px; color: #dee6ec; border-right: none;">1<br/></td> --> <td id="code"><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);">$variablename</span></span></code></td> </tr> </tbody></table> </div> </div> <span class="postbody"> <br /> <br />Right now there is nothing in the variable "$variablename". So lets add something.. <br />Example: <br /> <br /></span> <div align="center"> <div style="overflow: auto; width: 90%;"> <table align="center" border="0" cellpadding="3" cellspacing="1" width="100%"> <tbody><tr> <td colspan="1"><span class="genmed"><b>PHP-Code:</b></span></td> </tr> <tr> <!-- <td align="right" class="code" style="width: 5px; color: #dee6ec; border-right: none;">1<br/></td> --> <td id="code"><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);">$variablename </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">'John'</span><span style="color: rgb(0, 119, 0);">; </span><span style="color: rgb(0, 0, 187);"></span></span></code></td> </tr> </tbody></table> </div> </div> <span class="postbody"> <br /> <br />Now the variable "$variablename" holds the value "John". Think of it like this: If you opened up "$variablename" you would find the word "John" inside! (Just like PO Box "204" holds a postcard.) "Capitalization is very important in PHP. It is generally a good idea to have all variables be entirely lowercase, and only use alphanumeric characters along with underscores (_) if necessary. $greeting is not the same as $Greeting, so it is important to remain consistent and watch the typos." -<a href="http://www.tfproject.org/tfp/archive/index.php/t-33907.html" target="_blank" class="postlink">seretogis</a> Below is a list of links for you to follow so that you can learn the syntax of the PHP variables and how to use them. These are the best tutorials I have found so have fun and see you in lesson 3! <br /> <br /> <br /> <br /> <br /> </span> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/11684828293686686914' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/11684828293686686914' rel='author' title='author profile'> <span itemprop='name'>mohamed reda</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://domyat.blogspot.com/2008/03/lesson-2-php-code.html' itemprop='url'/> <a class='timestamp-link' href='http://domyat.blogspot.com/2008/03/lesson-2-php-code.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-03-31T07:40:00-07:00'>7:40 AM</abbr></a> </span> <span class='post-comment-link'> </span> <span class='post-icons'> <span class='item-control blog-admin pid-802097426'> <a href='https://www.blogger.com/post-edit.g?blogID=4889431653894848295&postID=3815839162010824324&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> <div class='comments' id='comments'> <a name='comments'></a> <h4>No comments:</h4> <div id='Blog1_comments-block-wrapper'> <dl class='avatar-comment-indent' id='comments-block'> </dl> </div> <p class='comment-footer'> <a href='https://www.blogger.com/comment/fullpage/post/4889431653894848295/3815839162010824324' onclick=''>Post a Comment</a> </p> </div> </div> </div></div> </div> <div class='blog-pager' id='blog-pager'> <span id='blog-pager-newer-link'> <a class='blog-pager-newer-link' href='http://domyat.blogspot.com/2008/03/lesson-3-strings.html' id='Blog1_blog-pager-newer-link' title='Newer Post'>Newer Post</a> </span> <span id='blog-pager-older-link'> <a class='blog-pager-older-link' href='http://domyat.blogspot.com/2008/03/welcome-to-beginning-php.html' id='Blog1_blog-pager-older-link' title='Older Post'>Older Post</a> </span> <a class='home-link' href='http://domyat.blogspot.com/'>Home</a> </div> <div class='clear'></div> <div class='post-feeds'> <div class='feed-links'> Subscribe to: <a class='feed-link' href='http://domyat.blogspot.com/feeds/3815839162010824324/comments/default' target='_blank' type='application/atom+xml'>Post Comments (Atom)</a> </div> </div> </div></div> </div> </div> <div class='column-left-outer'> <div class='column-left-inner'> <aside> </aside> </div> </div> <div class='column-right-outer'> <div class='column-right-inner'> <aside> <div class='sidebar section' id='sidebar-right-1'><div class='widget BlogArchive' data-version='1' id='BlogArchive1'> <h2>Blog Archive</h2> <div class='widget-content'> <div id='ArchiveList'> <div id='BlogArchive1_ArchiveList'> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='http://domyat.blogspot.com/2008/'> 2008 </a> <span class='post-count' dir='ltr'>(24)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='http://domyat.blogspot.com/2008/04/'> April </a> <span class='post-count' dir='ltr'>(2)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='http://domyat.blogspot.com/2008/03/'> March </a> <span class='post-count' dir='ltr'>(22)</span> <ul class='posts'> <li><a href='http://domyat.blogspot.com/2008/03/lesson-22-starting-off-with-databases.html'>Lesson 22 - Starting off with Databases</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-21-making-your-own-functions.html'>Lesson 21 - Making your own Functions</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-20-including-files-with-phps.html'>Lesson 20 - Including files with PHP's Include fun...</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-19-reading-external-files-into.html'>Lesson 19 - Reading External Files into PHP - Part 4</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-18-reading-external-files-into.html'>Lesson 18 - Reading External Files into PHP - Part 3</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-17-reading-external-files-into.html'>Lesson 17 - Reading External Files into PHP - Part 2</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-16-reading-external-files-into.html'>Lesson 16 - Reading External Files into PHP</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-15-explode.html'>Lesson 15 - Explode</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-14-arrays.html'>Lesson 14 - Arrays</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-13-intro-to-arrays.html'>Lesson 13 - Intro to Arrays</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-12-advanced-loops.html'>Lesson 12 - Advanced Loops</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-11-adv-strings.html'>Lesson 11 - Adv. Strings</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-10-review.html'>Lesson 10 - Review</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-9-loops-and-post.html'>Lesson 9 - Loops and POST</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-8-control-structures-2.html'>Lesson 8 - Control Structures 2</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-7-control-structures.html'>Lesson 7 - Control Structures</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-5-get-and-post_31.html'>Lesson 5 - GET and POST</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-5-get-and-post.html'>Lesson 5 - GET and POST</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-4-first-php-file.html'>Lesson 4 - First PHP File</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-3-strings.html'>Lesson 3 - Strings</a></li> <li><a href='http://domyat.blogspot.com/2008/03/lesson-2-php-code.html'>Lesson 2 - PHP Code</a></li> <li><a href='http://domyat.blogspot.com/2008/03/welcome-to-beginning-php.html'>Welcome to Beginning PHP!</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div class='clear'></div> </div> </div></div> <table border='0' cellpadding='0' cellspacing='0' class='section-columns columns-2'> <tbody> <tr> <td class='first columns-cell'> <div class='sidebar section' id='sidebar-right-2-1'><div class='widget HTML' data-version='1' id='HTML1'> <h2 class='title'>إعلان</h2> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client = "pub-7908943785549561"; google_ad_host = "pub-1556223355139109"; google_ad_host_channel="00000"; /* 728x90, تم إنشاؤها 01/04/08 */ google_ad_slot = "5424947032"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script> </div> <div class='clear'></div> </div></div> </td> <td class='columns-cell'> <div class='sidebar no-items section' id='sidebar-right-2-2'></div> </td> </tr> </tbody> </table> <div class='sidebar no-items section' id='sidebar-right-3'></div> </aside> </div> </div> </div> <div style='clear: both'></div> <!-- columns --> </div> <!-- main --> </div> </div> <div class='main-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> <footer> <div class='footer-outer'> <div class='footer-cap-top cap-top'> <div class='cap-left'></div> <div class='cap-right'></div> </div> <div class='fauxborder-left footer-fauxborder-left'> <div class='fauxborder-right footer-fauxborder-right'></div> <div class='region-inner footer-inner'> <div class='foot no-items section' id='footer-1'></div> <table border='0' cellpadding='0' cellspacing='0' class='section-columns columns-2'> <tbody> <tr> <td class='first columns-cell'> <div class='foot no-items section' id='footer-2-1'></div> </td> <td class='columns-cell'> <div class='foot no-items section' id='footer-2-2'></div> </td> </tr> </tbody> </table> <!-- outside of the include in order to lock Attribution widget --> <div class='foot section' id='footer-3' name='Footer'><div class='widget Attribution' data-version='1' id='Attribution1'> <div class='widget-content' style='text-align: center;'> Picture Window theme. Powered by <a href='https://www.blogger.com' target='_blank'>Blogger</a>. </div> <div class='clear'></div> </div></div> </div> </div> <div class='footer-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </footer> <!-- content --> </div> </div> <div class='content-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </div> <script type='text/javascript'> window.setTimeout(function() { document.body.className = document.body.className.replace('loading', ''); }, 10); </script> <script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/387437488-widgets.js"></script> <script type='text/javascript'> window['__wavt'] = 'AEUoTZr93YTXywg6vnaooXOXlWTS:1781517809917';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d4889431653894848295','//domyat.blogspot.com/2008/03/lesson-2-php-code.html','4889431653894848295'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '4889431653894848295', 'title': 'php', 'url': 'http://domyat.blogspot.com/2008/03/lesson-2-php-code.html', 'canonicalUrl': 'http://domyat.blogspot.com/2008/03/lesson-2-php-code.html', 'homepageUrl': 'http://domyat.blogspot.com/', 'searchUrl': 'http://domyat.blogspot.com/search', 'canonicalHomepageUrl': 'http://domyat.blogspot.com/', 'blogspotFaviconUrl': 'http://domyat.blogspot.com/favicon.ico', 'bloggerUrl': 'https://www.blogger.com', 'hasCustomDomain': false, 'httpsEnabled': true, 'enabledCommentProfileImages': true, 'gPlusViewType': 'FILTERED_POSTMOD', 'adultContent': false, 'analyticsAccountNumber': '', 'encoding': 'UTF-8', 'locale': 'en', 'localeUnderscoreDelimited': 'en', 'languageDirection': 'ltr', 'isPrivate': false, 'isMobile': false, 'isMobileRequest': false, 'mobileClass': '', 'isPrivateBlog': false, 'isDynamicViewsAvailable': true, 'feedLinks': '\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22php - Atom\x22 href\x3d\x22http://domyat.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22php - RSS\x22 href\x3d\x22http://domyat.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22php - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/4889431653894848295/posts/default\x22 /\x3e\n\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22php - Atom\x22 href\x3d\x22http://domyat.blogspot.com/feeds/3815839162010824324/comments/default\x22 /\x3e\n', 'meTag': '', 'adsenseClientId': 'pub-7908943785549561', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': false, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/cd96ebb13b57568d', 'plusOneApiSrc': 'https://apis.google.com/js/platform.js', 'disableGComments': true, 'interstitialAccepted': false, 'sharing': {'platforms': [{'name': 'Get link', 'key': 'link', 'shareMessage': 'Get link', 'target': ''}, {'name': 'Facebook', 'key': 'facebook', 'shareMessage': 'Share to Facebook', 'target': 'facebook'}, {'name': 'BlogThis!', 'key': 'blogThis', 'shareMessage': 'BlogThis!', 'target': 'blog'}, {'name': 'X', 'key': 'twitter', 'shareMessage': 'Share to X', 'target': 'twitter'}, {'name': 'Pinterest', 'key': 'pinterest', 'shareMessage': 'Share to Pinterest', 'target': 'pinterest'}, {'name': 'Email', 'key': 'email', 'shareMessage': 'Email', 'target': 'email'}], 'disableGooglePlus': true, 'googlePlusShareButtonWidth': 0, 'googlePlusBootstrap': '\x3cscript type\x3d\x22text/javascript\x22\x3ewindow.___gcfg \x3d {\x27lang\x27: \x27en\x27};\x3c/script\x3e'}, 'hasCustomJumpLinkMessage': false, 'jumpLinkMessage': 'Read more', 'pageType': 'item', 'postId': '3815839162010824324', 'pageName': 'Lesson 2 - PHP Code', 'pageTitle': 'php: Lesson 2 - PHP Code'}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': 'Edit', 'linkCopiedToClipboard': 'Link copied to clipboard!', 'ok': 'Ok', 'postLink': 'Post Link'}}, {'name': 'template', 'data': {'name': 'Picture Window', 'localizedName': 'Picture Window', 'isResponsive': false, 'isAlternateRendering': false, 'isCustom': false, 'variant': 'open', 'variantId': 'open'}}, {'name': 'view', 'data': {'classic': {'name': 'classic', 'url': '?view\x3dclassic'}, 'flipcard': {'name': 'flipcard', 'url': '?view\x3dflipcard'}, 'magazine': {'name': 'magazine', 'url': '?view\x3dmagazine'}, 'mosaic': {'name': 'mosaic', 'url': '?view\x3dmosaic'}, 'sidebar': {'name': 'sidebar', 'url': '?view\x3dsidebar'}, 'snapshot': {'name': 'snapshot', 'url': '?view\x3dsnapshot'}, 'timeslide': {'name': 'timeslide', 'url': '?view\x3dtimeslide'}, 'isMobile': false, 'title': 'Lesson 2 - PHP Code', 'description': 'If you visited the link in the last lesson you probably already know how to tell PHP code and how to comment it. Never the less, I want to m...', 'url': 'http://domyat.blogspot.com/2008/03/lesson-2-php-code.html', 'type': 'item', 'isSingleItem': true, 'isMultipleItems': false, 'isError': false, 'isPage': false, 'isPost': true, 'isHomepage': false, 'isArchive': false, 'isLabelSearch': false, 'postId': 3815839162010824324}}]); _WidgetManager._RegisterWidget('_NavbarView', new _WidgetInfo('Navbar1', 'navbar', document.getElementById('Navbar1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'lightboxEnabled': true, 'lightboxModuleUrl': 'https://www.blogger.com/static/v1/jsbin/1053750561-lbx.js', 'lightboxCssUrl': 'https://www.blogger.com/static/v1/v-css/828616780-lightbox_bundle.css'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogArchiveView', new _WidgetInfo('BlogArchive1', 'sidebar-right-1', document.getElementById('BlogArchive1'), {'languageDirection': 'ltr', 'loadingMessage': 'Loading\x26hellip;'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML1', 'sidebar-right-2-1', document.getElementById('HTML1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AttributionView', new _WidgetInfo('Attribution1', 'footer-3', document.getElementById('Attribution1'), {}, 'displayModeFull')); </script> </body> </html>