<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8566775542304208489</atom:id><lastBuildDate>Mon, 28 Nov 2011 00:43:24 +0000</lastBuildDate><category>Data Backup</category><category>Stocks and Sauces</category><category>Java examples</category><category>Swing Dance</category><category>Tap Dance</category><category>PHP Examples</category><category>Assemble A PC</category><category>Guitar Solo</category><category>Appetizers and Snacks</category><category>Tennis Lessons</category><category>PHP Tutorials</category><category>Salsa Dance</category><category>ASP examples</category><category>C++ Lesson</category><category>Fish</category><category>Learning English</category><category>Laptop RAM Change</category><category>Poultry</category><category>Java</category><category>Break Dance</category><category>Soups</category><category>Mambo Dance</category><category>Meat</category><category>Web Hosting</category><category>Install JDK</category><category>PHP</category><category>Seafood</category><category>Rice and Noodles</category><category>Other Recipes</category><category>Most Favorite Songs</category><category>Slow Dance</category><category>Install Windows XP</category><category>Waltz Dance</category><category>Eclipse</category><category>Hip Hop Dance</category><category>Vegetables</category><category>Salad</category><category>Tango Dance</category><category>Foreign Recipes</category><category>Rumba Dance</category><category>News</category><title>VN4000</title><description>A Champion a is dreamer that refused to give up!
Never give up, you will be close to success when you want to quit.</description><link>http://vn4000.blogspot.com/</link><managingEditor>noreply@blogger.com (vn4000)</managingEditor><generator>Blogger</generator><openSearch:totalResults>2228</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Vn4000" /><feedburner:info uri="vn4000" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Vn4000</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-5618137472530618351</guid><pubDate>Fri, 05 Jun 2009 23:41:00 +0000</pubDate><atom:updated>2009-06-06T16:27:50.998-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - File Upload</title><description>You must first build an HTML form that lets users select a file to upload.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&amp;lt;form enctype="multipart/form-data" action="uploader.php" method="POST"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&amp;lt;input type="hidden" name="MAX_FILE_SIZE" value="100000" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Choose a file to upload: &amp;lt;input name="uploadedfile" type="file" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&amp;lt;input type="submit" value="Upload File" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;enctype="multipart/form-data"&lt;/b&gt; - Necessary for our to-be-created PHP file to function properly. The enctype attribute specifies how form-data should be encoded before  sending it to the server. See table below.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;action="uploader.php"&lt;/b&gt; - The name of our PHP page that will be created, shortly.&lt;/li&gt;&lt;li&gt;&lt;b&gt;method="POST"&lt;/b&gt; - Informs the browser that we want to send information to the server using POST.&lt;/li&gt;&lt;li&gt;&lt;b&gt;input type="hidden" name="MA...&lt;/b&gt; - Sets the maximum allowable file size, in bytes, that can be uploaded.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;input name="uploadedfile" &lt;/b&gt; - &lt;i&gt;uploadedfile&lt;/i&gt; is how we will access the file in our PHP script.&lt;/li&gt;&lt;/ul&gt;  &lt;h2&gt;&lt;span style="font-size:100%;"&gt;Attribute Values&lt;/span&gt;&lt;/h2&gt; &lt;table class="reference" border="1" cellpadding="0" cellspacing="0" width="100%"&gt;   &lt;tbody&gt;&lt;tr&gt;     &lt;th align="left" valign="top" width="40%"&gt;Value&lt;/th&gt;     &lt;th align="left" valign="top" width="60%"&gt;Description&lt;/th&gt;   &lt;/tr&gt;     &lt;tr&gt;     &lt;td valign="top"&gt;application/x-www-form-urlencoded&lt;/td&gt;     &lt;td valign="top"&gt;All characters are encoded before sent (this is default)&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td valign="top"&gt;multipart/form-data&lt;/td&gt;     &lt;td valign="top"&gt;No characters are encoded. This value is required when you   are using forms that have a file upload control&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td valign="top"&gt;text/plain&lt;/td&gt;     &lt;td valign="top"&gt;Spaces are converted to "+" symbols, but no special characters are encoded&lt;/td&gt;   &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Save that form code into a file and call it &lt;i&gt;upload.html&lt;/i&gt;.&lt;br /&gt;After the user clicks submit, the data will be posted to the server and the user will be redirected to &lt;i&gt;uploader.php&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;When the uploader.php file is executed, the uploaded file exists in a temporary storage area on the server. If the file is not moved to a different location it will be destroyed!&lt;br /&gt;&lt;br /&gt;Here is uploader.php&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$target_path = "uploads/";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    echo "The file ".  basename( $_FILES['uploadedfile']['name']). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    " has been uploaded";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;} else{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    echo "There was an error uploading the file, please try again!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The  &lt;i&gt;$_FILES&lt;/i&gt; array is where PHP stores all the information about files.&lt;br /&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;b&gt;uploadedfile&lt;/b&gt; - &lt;i&gt;uploadedfile&lt;/i&gt; is the reference we assigned in our HTML form.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;$_FILES['uploadedfile']['name']&lt;/b&gt; - &lt;i&gt;name&lt;/i&gt; contains the original path of the user uploaded file.&lt;/li&gt;&lt;li&gt;&lt;b&gt;$_FILES['uploadedfile']['tmp_name']&lt;/b&gt; - &lt;i&gt;tmp_name&lt;/i&gt; contains the path to the temporary file that resides on the server.  The file should exist on   the server in a temporary directory with a temporary name.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-5618137472530618351?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5Wb1rwi4T7xLhxn55e_wNrdu0t0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5Wb1rwi4T7xLhxn55e_wNrdu0t0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5Wb1rwi4T7xLhxn55e_wNrdu0t0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5Wb1rwi4T7xLhxn55e_wNrdu0t0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/87_CYZsUlxw/php-file-upload.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-file-upload.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-7620470662438709453</guid><pubDate>Fri, 05 Jun 2009 22:50:00 +0000</pubDate><atom:updated>2009-06-05T16:41:07.709-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - File Append</title><description>If we want to add on to a file we need to open it up in append mode.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$myFile = "testFile.txt";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$fh = fopen($myFile, 'a');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then we use &lt;span style="font-weight: bold;"&gt;fwrite()&lt;/span&gt; to write to the file. It would begin writing data at the end of the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$myFile = "testFile.txt";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$fh = fopen($myFile, 'a') or die("can't open file");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$stringData = "Hello\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;fwrite($fh, $stringData);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$stringData = "We are vn4000\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;fwrite($fh, $stringData);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;fclose($fh);&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-7620470662438709453?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jHcSdKz2E4syd3Zb2wk-TNLhYYk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jHcSdKz2E4syd3Zb2wk-TNLhYYk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jHcSdKz2E4syd3Zb2wk-TNLhYYk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jHcSdKz2E4syd3Zb2wk-TNLhYYk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/MlVYTmQMuig/php-file-append.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-file-append.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-4679775950917363061</guid><pubDate>Fri, 05 Jun 2009 22:32:00 +0000</pubDate><atom:updated>2009-06-05T15:38:13.284-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - File Delete</title><description>We use &lt;span style="font-weight: bold;"&gt;unlink()&lt;/span&gt; to delete existing files&lt;br /&gt;&lt;br /&gt;Before you can delete a file, you must first be sure that it is not open in your program.  Use the &lt;i&gt;fclose&lt;/i&gt; function to close down an open file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$myFile = "testFile.txt";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$fh = fopen($myFile, 'w') or die("can't open file");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;fclose($fh);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$myFile = "testFile.txt";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;unlink($myFile);&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-4679775950917363061?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eaPEwHDvNPowSb2xehCwcA3_K-U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eaPEwHDvNPowSb2xehCwcA3_K-U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eaPEwHDvNPowSb2xehCwcA3_K-U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eaPEwHDvNPowSb2xehCwcA3_K-U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/B5DtiJ_62vA/php-file-delete.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-file-delete.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-8091491291676636502</guid><pubDate>Fri, 05 Jun 2009 00:58:00 +0000</pubDate><atom:updated>2009-06-05T15:38:35.727-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - File Read</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;The &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;fgets()&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; functions is used to read a line from a file. Using this function we either read the entire line into a string or specify the number characters we like to read.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;fgets ($handle, $length);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;    &lt;/p&gt;&lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;$handle - the file pointer&lt;/li&gt;&lt;li&gt;$length - number of bytes to read. If length is not specified it will read at the end of the line.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h4 style="color: rgb(0, 0, 0);" id="s1.1"&gt;Reading entire line&lt;/h4&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$fh = fopen("myfile.txt", "r");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$line = fgets($fh);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo $line;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;fclose($fh);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4 style="color: rgb(0, 0, 0);" id="s1.2"&gt;Reading number of bytes&lt;/h4&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$fh = fopen("myfile.txt", "r");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$str = fgets($fh, 64);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo $str;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$line2 = fgets($fh, 64);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo $str;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;fclose($fh);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4 style="color: rgb(0, 0, 0);" id="s1.3"&gt;Reading file line by line&lt;/h4&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$fh = fopen("myfile.txt", "r");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;while(true)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    $line = fgets($fh);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    if($line == null)break;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo $line;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;fclose($fh);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 style="color: rgb(0, 0, 0);" id="s2"&gt;Reading entire file at once&lt;/h3&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;$fh = fopen("myfile.txt", "r");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;$file = file_get_contents("myfile.txt");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;echo $file;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;?&amp;gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-8091491291676636502?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-235IBLdHlqRRP-KaG9jHaKLaKI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-235IBLdHlqRRP-KaG9jHaKLaKI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-235IBLdHlqRRP-KaG9jHaKLaKI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-235IBLdHlqRRP-KaG9jHaKLaKI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/ab93si3ZHCU/php-file-read.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-file-read.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-813546685346305309</guid><pubDate>Fri, 05 Jun 2009 00:09:00 +0000</pubDate><atom:updated>2009-06-05T15:38:50.714-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - File Write</title><description>We can easily write text to files using the &lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;fwrite()&lt;/span&gt; function. However, you must make sure to open file in writable mode before writing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$myFile = "testFile.txt";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$fh = fopen($myFile, 'w') or die("can't open file");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$stringData = "Hello\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;fwrite($fh, $stringData);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$stringData = "Welcome to vn4000\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;fwrite($fh, $stringData);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;fclose($fh);&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-813546685346305309?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3oJa4TgqFG5Jv3svwVYA4rtTVWU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3oJa4TgqFG5Jv3svwVYA4rtTVWU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3oJa4TgqFG5Jv3svwVYA4rtTVWU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3oJa4TgqFG5Jv3svwVYA4rtTVWU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/qMOqHzLtjak/php-file-write.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-file-write.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-7073093310948862593</guid><pubDate>Thu, 04 Jun 2009 22:21:00 +0000</pubDate><atom:updated>2009-06-05T15:39:03.829-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - File Close</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;The fclose() function is used to close an open file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$file = fopen("test.txt","r");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;//some code to be executed&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;fclose($file);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;After a file has been closed down with &lt;/span&gt;&lt;i style="color: rgb(0, 0, 0);"&gt;fclose&lt;/i&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; it is impossible to read, write or append to that file unless it is once more opened up with the &lt;/span&gt;&lt;i style="color: rgb(0, 0, 0);"&gt;fopen&lt;/i&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; function.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-7073093310948862593?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5vQjctQQ-pAF7fouQTv1aKZU0Bk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5vQjctQQ-pAF7fouQTv1aKZU0Bk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5vQjctQQ-pAF7fouQTv1aKZU0Bk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5vQjctQQ-pAF7fouQTv1aKZU0Bk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/AbAwjdfKAC4/php-file-close.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-file-close.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-2657121490843079815</guid><pubDate>Thu, 04 Jun 2009 22:01:00 +0000</pubDate><atom:updated>2009-06-05T15:39:22.581-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - File Open</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;We also use &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;fopen()&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; to open existing files as well.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;The function &lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;fopen()&lt;/span&gt; takes in two arguments, the filename and the mode to either open or create a file.&lt;/p&gt;             &lt;p style="color: rgb(0, 0, 0);"&gt;    &lt;/p&gt;&lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;&lt;b&gt;$filename&lt;/b&gt; - the name of the file. This may also include the absolute path where you want to create the file. Example, "/www/myapp/myfile.txt".&lt;/li&gt;&lt;li&gt;&lt;b&gt;$mode&lt;/b&gt; - mode is used to specify how you want to create the file. For example, you can set the mode to create for read only, or create a file for read and write. Below is the list of possible modes you can use.&lt;/li&gt;&lt;/ul&gt;        &lt;h4 style="color: rgb(0, 0, 0);" id="s1.1"&gt;&lt;p&gt;PHP file fopen create modes&lt;/p&gt;&lt;/h4&gt;        &lt;table style="color: rgb(0, 0, 0);" class="content_table"&gt;&lt;tbody&gt;&lt;tr&gt;     &lt;td&gt;     'w'     &lt;/td&gt;     &lt;td&gt; Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, it attempt to create it. &lt;/td&gt;    &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;     'w+'     &lt;/td&gt;     &lt;td&gt; Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. &lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;     &lt;td&gt;      'a'     &lt;/td&gt;     &lt;td&gt;Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;&lt;td&gt;      'a+'     &lt;/td&gt;     &lt;td&gt;Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;There are additional ways to open a file.&lt;br /&gt;&lt;/p&gt; &lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;&lt;b&gt;Read/Write: 'r+'&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;Opens a file so that it can be read from and written to.  The file pointer is at the beginning of the file.&lt;/p&gt;  &lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;&lt;b&gt;Write/Read: 'w+'&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;This is exactly the same as r+, &lt;b&gt;except&lt;/b&gt; that it deletes all information in the file when the file is opened.&lt;/p&gt;  &lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;&lt;b&gt;Append: 'a+'&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;This is exactly the same as r+, &lt;b&gt;except&lt;/b&gt; that the file pointer is at the end of the file.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-2657121490843079815?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ICMmdAIKpbawKkBjHOVJWjSbBas/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ICMmdAIKpbawKkBjHOVJWjSbBas/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ICMmdAIKpbawKkBjHOVJWjSbBas/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ICMmdAIKpbawKkBjHOVJWjSbBas/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/OQ4MdSg36O4/php-file-open.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-file-open.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-5851446630724677127</guid><pubDate>Thu, 04 Jun 2009 21:31:00 +0000</pubDate><atom:updated>2009-06-05T15:39:56.151-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - File Create</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;Using the PHP file system function &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);" &gt;fopen()&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, we can create a new file&lt;/span&gt;&lt;br /&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;The function &lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;fopen()&lt;/span&gt; takes in two arguments, the filename and the mode to either open or create a file.&lt;/p&gt;             &lt;p style="color: rgb(0, 0, 0);"&gt;    &lt;/p&gt;&lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;&lt;b&gt;$filename&lt;/b&gt; - the name of the file. This may also include the absolute path where you want to create the file. Example, "/www/myapp/myfile.txt".&lt;/li&gt;&lt;li&gt;&lt;b&gt;$mode&lt;/b&gt; - mode is used to specify how you want to create the file. For example, you can set the mode to create for read only, or create a file for read and write.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;$ourFileName = "testFile.txt";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;fclose($ourFileHandle);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;&lt;b&gt;$ourFileName = "testFile.txt";&lt;/b&gt;   &lt;p&gt;The name of our file is  "testFile.txt" and  it is stored into a String variable &lt;i&gt;$ourFileName&lt;/i&gt;.&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;b&gt;$ourFileHandle = fopen($ourFileName, 'w')&lt;/b&gt; or die("can't open file");   &lt;p&gt;We use the function &lt;i&gt;fopen&lt;/i&gt; and give it two arguments: our file name and we inform   PHP that we want to write by passing the character "w".&lt;/p&gt;     &lt;/li&gt;&lt;li&gt;&lt;b&gt;fclose($ourFileHandle);&lt;/b&gt;   &lt;p&gt;We close the file that was opened.  &lt;i&gt;fclose&lt;/i&gt; takes the file handle that is to be closed.&lt;br /&gt;&lt;/p&gt;  &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-5851446630724677127?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ypaSPiSvwSlwuTP_gIrl5E9seKE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ypaSPiSvwSlwuTP_gIrl5E9seKE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ypaSPiSvwSlwuTP_gIrl5E9seKE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ypaSPiSvwSlwuTP_gIrl5E9seKE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/UmQpjSx2Ls4/php-file-create.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-file-create.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-7366217603186950814</guid><pubDate>Thu, 04 Jun 2009 21:04:00 +0000</pubDate><atom:updated>2009-06-05T15:40:17.878-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP Post and Get</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;Both the &lt;/span&gt;&lt;tt style="color: rgb(0, 0, 0);"&gt;GET&lt;/tt&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; and &lt;/span&gt;&lt;tt style="color: rgb(0, 0, 0);"&gt;POST&lt;/tt&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; methods send data to the server.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The &lt;/span&gt;&lt;tt style="color: rgb(0, 0, 0);"&gt;POST&lt;/tt&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; method was intended to create a resource. The contents of the resource would be encoded into the body of the HTTP request.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The &lt;/span&gt;&lt;tt style="color: rgb(0, 0, 0);"&gt;GET&lt;/tt&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; method is different in that it passes the variables along to the PHP web page by appending them onto the end of the URL&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;Use the &lt;tt&gt;POST&lt;/tt&gt; method if any of the following are true:&lt;/p&gt;    &lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;       &lt;p&gt;The result of the request has persistent side effects such as adding a new database row.&lt;/p&gt;     &lt;/li&gt;&lt;li&gt;       &lt;p&gt;If the data collected on the form is likely to result in a large URL if implemented using the &lt;tt&gt;GET&lt;/tt&gt; method.&lt;/p&gt;     &lt;/li&gt;&lt;li&gt;       &lt;p&gt;The data to be sent is in any encoding other than seven-bit ASCII.&lt;/p&gt;     &lt;/li&gt;&lt;/ul&gt;    &lt;p style="color: rgb(0, 0, 0);"&gt;Use the &lt;tt&gt;GET&lt;/tt&gt; method if all the following are true:&lt;/p&gt;    &lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;       &lt;p&gt;If the request is essentially finding a resource, and HTML &lt;tt&gt;&lt;/tt&gt;&lt;/p&gt;form&lt;tt&gt;&lt;/tt&gt; data is to help that search.&lt;p&gt;&lt;/p&gt;     &lt;/li&gt;&lt;li&gt;       &lt;p&gt;The result of the request has no persistent side effects.&lt;/p&gt;     &lt;/li&gt;&lt;li&gt;       &lt;p&gt;If the data collected and the input field names in a HTML &lt;tt&gt;&lt;/tt&gt;&lt;/p&gt;&lt;tt&gt;&lt;/tt&gt; are less than 1,024 characters in length.&lt;p&gt;&lt;/p&gt;     &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-7366217603186950814?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GkXapXHt7aYnipdRyvu1QByMlaQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GkXapXHt7aYnipdRyvu1QByMlaQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GkXapXHt7aYnipdRyvu1QByMlaQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GkXapXHt7aYnipdRyvu1QByMlaQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/29fXEEDQpcI/php-post-and-get.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-post-and-get.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-8174940248140021211</guid><pubDate>Thu, 04 Jun 2009 20:50:00 +0000</pubDate><atom:updated>2009-06-05T15:40:34.502-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - Do while</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;A do-while loop checks the test condition (the condition that is defined inside the while) at the end of the loop. Regular while loops check the test condition at the beginning of the loop.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;PHP While loop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;br /&gt;$i = 0;&lt;br /&gt;while($i &amp;gt; 0){&lt;br /&gt; echo $i;&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;As you can see, this while loop's conditional statement failed ($i is not greater than 0), which means the code within the while loop was not executed&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;PHP Do While loop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$i = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;do {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo $i;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;} while ($i &amp;gt; 0);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The above loop would run one time exactly, since after the first    iteration, when truth expression is checked, it evaluates to    &lt;/span&gt;&lt;b style="color: rgb(0, 0, 0);"&gt;&lt;tt class="constant"&gt;FALSE&lt;/tt&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;var style="color: rgb(0, 0, 0);" class="varname"&gt;$i&lt;/var&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; is not bigger than 0) and the loop    execution ends.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-8174940248140021211?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xhc1OdaSqeRqhVTDPEAbNU_TKMk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xhc1OdaSqeRqhVTDPEAbNU_TKMk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xhc1OdaSqeRqhVTDPEAbNU_TKMk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xhc1OdaSqeRqhVTDPEAbNU_TKMk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/SHU-Zgs2cmw/php-do-while.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-do-while.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-1910857365944319444</guid><pubDate>Wed, 03 Jun 2009 17:18:00 +0000</pubDate><atom:updated>2009-06-05T15:40:51.445-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - For each</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;PHP provides an easy way to use every element of an array with the &lt;/span&gt;&lt;i style="color: rgb(0, 0, 0);"&gt;Foreach&lt;/i&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; statement.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;Example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Hoang"] = "28";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Thao"] = "19";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Tuan"] = "25";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Mai"] = "26";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Hoa"] = "32";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;foreach( $employeeAges as $key =&gt; $value){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo "Name: $key, Age: $value&lt;br /&gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;$something as $key =&gt; $value&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The operator "=&gt;" represents the relationship between a &lt;/span&gt;&lt;i style="color: rgb(0, 0, 0);"&gt;key&lt;/i&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; and &lt;/span&gt;&lt;i style="color: rgb(0, 0, 0);"&gt;value&lt;/i&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;. Example, we only changed the variable names that refer to the keys and values&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges;&lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Hoang"] = "28";&lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Thao"] = "19";&lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Tuan"] = "25";&lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Mai"] = "26";&lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$employeeAges["Hoa"] = "32";&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;foreach( $employeeAges as $&lt;span style="font-weight: bold;"&gt;name&lt;/span&gt;=&gt; $&lt;span style="font-weight: bold;"&gt;age&lt;/span&gt;){&lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo "Name: $&lt;span style="font-weight: bold;"&gt;name&lt;/span&gt;, Age: $&lt;span style="font-weight: bold;"&gt;age&lt;/span&gt;&lt;br /&gt;";&lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-1910857365944319444?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gpQrZs661l-7tu0tZgAxdrXysEs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gpQrZs661l-7tu0tZgAxdrXysEs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gpQrZs661l-7tu0tZgAxdrXysEs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gpQrZs661l-7tu0tZgAxdrXysEs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/UYT81cnA6UU/php-for-each.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-for-each.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-1952702122173720258</guid><pubDate>Wed, 03 Jun 2009 17:04:00 +0000</pubDate><atom:updated>2009-06-05T15:41:28.614-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - For Loop</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;The common tasks that are covered by a for loop are:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;Set a counter variable to some initial value.&lt;/li&gt;&lt;li&gt;Check to see if the conditional statement is true.&lt;/li&gt;&lt;li&gt;Execute the code within the loop.&lt;/li&gt;&lt;li&gt;Increment a counter at the end of each iteration through the loop.&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;The basic structure of the for loop:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="color: rgb(0, 0, 0);" class="code"&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;for ( initialize a counter; conditional statement; increment a counter){&lt;br /&gt;do this code;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;   For loop has three statements.    &lt;/p&gt;&lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;In the first statement, we initialize a counter variable to an number value.&lt;/li&gt;&lt;li&gt;In the second statement, we set a condition (a max/min number value) until the counter is reached.&lt;/li&gt;&lt;li&gt;In the third statement, we set a value by how much we want the counter variable to incremented by.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    for($i=0; $i&amp;lt;=5; $i=$i+1)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;        echo $i." ";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Will Print number through 0 to 5&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-1952702122173720258?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/llC_yLMnVe3Rglgh_3gKYnKPCj4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/llC_yLMnVe3Rglgh_3gKYnKPCj4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/llC_yLMnVe3Rglgh_3gKYnKPCj4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/llC_yLMnVe3Rglgh_3gKYnKPCj4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/FQhK1uZ860o/php-for-loop.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-for-loop.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-3965355222903581522</guid><pubDate>Wed, 03 Jun 2009 00:14:00 +0000</pubDate><atom:updated>2009-06-05T15:43:04.023-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP -While Loop</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;Here is the basic structure of a PHP while loop:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="color: rgb(0, 0, 0);" class="code"&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;while ( conditional statement is true){&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt; //do this code;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;Example&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; - Print number through 1 to 5 with PHP While Loop&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$i = 1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;while ($i &amp;lt;= 5 )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo $i . "&amp;lt;br&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    $i = $i + 1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-3965355222903581522?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GxGWWi7oct87gn4m1K6p_S-IGec/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GxGWWi7oct87gn4m1K6p_S-IGec/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GxGWWi7oct87gn4m1K6p_S-IGec/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GxGWWi7oct87gn4m1K6p_S-IGec/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/KF6d6lqxq-w/php-while-loop.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-while-loop.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-1408381694856830679</guid><pubDate>Wed, 03 Jun 2009 00:06:00 +0000</pubDate><atom:updated>2009-06-05T15:43:40.321-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - Array</title><description>&lt;span style="color: rgb(0, 0, 0);"&gt;An array is a data structure that stores one or more values in a single value.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;Structure of an array&lt;/span&gt;&lt;br /&gt;&lt;pre style="color: rgb(0, 0, 0);" class="code"&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;$employee_array[0] = "Hung";&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;$employee_array[1] = "Thao";&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;$employee_array[2] = "Thang";&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;$employee_array[3] = "Hoa";&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The general form for setting the key of an array equal to a value is: &lt;/span&gt;&lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;$array[&lt;i&gt;key&lt;/i&gt;] = &lt;i&gt;value&lt;/i&gt;;&lt;/li&gt;&lt;/ul&gt;&lt;b style="color: rgb(0, 0, 0);"&gt;Note:&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; As you may have noticed from the above code example, an array's keys start from 0 and not 1.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;Display content:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="color: rgb(0, 0, 0);" class="code"&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;echo "Two of my employees are "&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;. $employee_array[0] . " &amp;amp; " . $employee_array[1]; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;echo "&lt;br /&gt;Two more employees of mine are " &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);font-size:130%;" &gt;. $employee_array[2] . " &amp;amp; " . $employee_array[3];&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-1408381694856830679?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lSVTcoJOafP_iSHZs4IiPVuSp5I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lSVTcoJOafP_iSHZs4IiPVuSp5I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lSVTcoJOafP_iSHZs4IiPVuSp5I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lSVTcoJOafP_iSHZs4IiPVuSp5I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/O47qzukZL5g/php-array.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-array.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-8099656040049159113</guid><pubDate>Tue, 02 Jun 2009 18:05:00 +0000</pubDate><atom:updated>2009-06-05T15:44:16.202-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - Functions</title><description>A function is just a name we give to a block of code that can be executed whenever we need it. When you create a function, you first need to give it a name, like &lt;i&gt;myFunction&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Create Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;function myFunction(){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo "Hello, We are vn4000!&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Using your Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;function myFunction(){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo "We are vn4000!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "Welcome to our homepage. ";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;myCompanyMotto();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Function Parameters&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;function myGreeting($name){&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo "Hello there ". $firstName . "!&amp;lt;br /&amp;gt;";&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;myGreeting("vn4000");&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;Function returning Values&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(153, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;function mySum($numX, $numY){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   $total = $numX + $numY;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   return $total;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;$myNumber = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;echo "Before the function, myNumber = ". $myNumber ."&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;$myNumber = mySum(3, 4); // Store the result of mySum in $myNumber&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;echo "After the function, myNumber = " . $myNumber ."&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-8099656040049159113?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hLhi_uglbmhxdmKqfjSiody6geo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hLhi_uglbmhxdmKqfjSiody6geo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hLhi_uglbmhxdmKqfjSiody6geo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hLhi_uglbmhxdmKqfjSiody6geo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/4MVu4MJEZ-g/php-functions.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-functions.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-6935157539977289036</guid><pubDate>Tue, 02 Jun 2009 14:38:00 +0000</pubDate><atom:updated>2009-06-05T15:44:46.511-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - Switch Statement</title><description>&lt;p style="color: rgb(0, 0, 0);"&gt;With the use of the &lt;i&gt;switch&lt;/i&gt; statement you can check for all these conditions at once. The way the Switch statement works is it takes a single variable as input and then checks it against all the different &lt;i&gt;cases&lt;/i&gt; you set up for that  &lt;i&gt;switch&lt;/i&gt; statement.&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;Example&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;switch ($y)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;case 1:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "y equals to 1";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;case 2:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "y equals to 2";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;case 3:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "y equals to 3";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;default:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "y is not equals to 1, 2 or 3";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-6935157539977289036?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8QtMz3KwytgSRT63BS0z8VtSWxs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8QtMz3KwytgSRT63BS0z8VtSWxs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8QtMz3KwytgSRT63BS0z8VtSWxs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8QtMz3KwytgSRT63BS0z8VtSWxs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/cZ4FYxT0hMg/php-switch-statement.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-switch-statement.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-1934790954010443764</guid><pubDate>Tue, 02 Jun 2009 00:20:00 +0000</pubDate><atom:updated>2009-06-05T15:50:09.446-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - If...Else</title><description>&lt;span style="font-weight: bold;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$the_number = 4000;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;if ( $the_number == 4000 ) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo "The if statement evaluated to true";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;} else {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo "The if statement evaluated to false";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   *  We first made a PHP variable called $the_number and set it equal to 4000.&lt;br /&gt;   * In this example we compared a variable to an integer value. To do such a comparison we use "==", which in English means "Is Equal To".&lt;br /&gt;   * $the_number is indeed Equal To 4000 and so this statement will evaluate to true.&lt;br /&gt;   * All code that is contained between the opening curly brace "{" that follows the if statement and the closing curly brace "}" will be executed when the if statement is true.&lt;br /&gt;   * The code contained within the else segment will not used.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-1934790954010443764?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Brsmww6ubLIqCyiJ1dt_djFZ7OY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Brsmww6ubLIqCyiJ1dt_djFZ7OY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Brsmww6ubLIqCyiJ1dt_djFZ7OY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Brsmww6ubLIqCyiJ1dt_djFZ7OY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/KSuGkHDE_w4/php-ifelse.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-ifelse.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-7318715316987251686</guid><pubDate>Mon, 01 Jun 2009 20:02:00 +0000</pubDate><atom:updated>2009-06-05T15:49:54.695-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - If Statement</title><description>&lt;span style="font-weight: bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$my_name = "vn4000";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;if ( $my_name == "vn4000" ) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;    echo "Your name is vn4000!&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "Welcome to my homepage!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;We first set the variable $my_name equal to "vn4000".&lt;/li&gt;&lt;li&gt;We next used a PHP if statement to check if the value contained in the  variable $my_name was equal to "vn4000"&lt;/li&gt;&lt;li&gt;The comparison between $my_name and "vn4000" was done with a double equal  sign "==", not a single equals"="! A single equals is for assigning a value  to a variable, while a double equals is for checking if things are equal.&lt;/li&gt;&lt;li&gt;Translated into english the PHP statement ( $my_name == "vn4000" ) is ( $my_name  is equal to "vn4000" ).&lt;/li&gt;&lt;li&gt;$my_name is indeed equal to "vn4000" so the echo statement is executed.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-7318715316987251686?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PrwUNiH2pwgFlrP04lPc7yJoqCg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PrwUNiH2pwgFlrP04lPc7yJoqCg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PrwUNiH2pwgFlrP04lPc7yJoqCg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PrwUNiH2pwgFlrP04lPc7yJoqCg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/H-1Tyl9CI-I/php-if-statement.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-if-statement.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-533828355148993729</guid><pubDate>Mon, 01 Jun 2009 18:42:00 +0000</pubDate><atom:updated>2009-06-01T13:02:03.995-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - Include File</title><description>The PHP &lt;i&gt;include&lt;/i&gt; command takes a file name and simply inserts that file's contents into the script that issued the &lt;i&gt;include&lt;/i&gt; command.&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;link.php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;a href="http://www.vn4000.com/index.php"&amp;gt;vn4000&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;index.php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?php include("link.php"); ?&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;Hello World!&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-533828355148993729?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Usb-OCag9HBAcp-rD1hjUidHGYw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Usb-OCag9HBAcp-rD1hjUidHGYw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Usb-OCag9HBAcp-rD1hjUidHGYw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Usb-OCag9HBAcp-rD1hjUidHGYw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/zwuJJ5zD0-k/php-include-file.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-include-file.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-470042566122370879</guid><pubDate>Mon, 01 Jun 2009 18:35:00 +0000</pubDate><atom:updated>2009-06-05T15:49:06.176-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - Comments</title><description>&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;Single Line Comment&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "Hello World!"; // This will print out Hello World!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Multiple Line Comment&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "Hello World!"; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;/* echo "My name is vn4000!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "We are&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;PHP Programmers!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Display:&lt;br /&gt;&lt;br /&gt;Hello World!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-470042566122370879?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PlJ53lYceY0dpE-kLHEo2uTGHUY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PlJ53lYceY0dpE-kLHEo2uTGHUY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PlJ53lYceY0dpE-kLHEo2uTGHUY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PlJ53lYceY0dpE-kLHEo2uTGHUY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/GcQVSpEppjI/php-comments.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-comments.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-2356681266516222689</guid><pubDate>Mon, 01 Jun 2009 18:18:00 +0000</pubDate><atom:updated>2009-06-05T15:48:43.394-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - Operators</title><description>There are 5 categories of operators in PHP&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Assignment Operators&lt;/li&gt;&lt;li&gt;Arithmetic Operators&lt;/li&gt;&lt;li&gt;Comparison Operators&lt;/li&gt;&lt;li&gt;String Operators&lt;/li&gt;&lt;li&gt;Combination Arithmetic &amp;amp; Assignment Operators&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Assignment operators&lt;/span&gt; are used to set a variable equal to a value or set a variable to another variable's value.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;$my_var = vn4000;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Arithmetic Operators&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" border="1" cellspacing="1"&gt;   &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;English&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt;+&lt;/td&gt; &lt;td&gt;Addition&lt;/td&gt;  &lt;td&gt;2 + 4&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt;-&lt;/td&gt; &lt;td&gt;Subtraction&lt;/td&gt; &lt;td&gt;6 - 2&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt;*&lt;/td&gt; &lt;td&gt;Multiplication&lt;/td&gt; &lt;td&gt;5 * 3&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt;/&lt;/td&gt; &lt;td&gt;Division&lt;/td&gt;  &lt;td&gt;15 / 3&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt;%&lt;/td&gt; &lt;td&gt;Modulus&lt;/td&gt;  &lt;td&gt;43 % 10&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Comparison Operators&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Comparisons are used to check the relationship between variables and/or values.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" border="1" cellpadding="1" cellspacing="1"&gt;   &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;English&lt;/th&gt;     &lt;th&gt;Example&lt;/th&gt;  &lt;th&gt;Result&lt;/th&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt; == &lt;/td&gt; &lt;td&gt;Equal To&lt;/td&gt;     &lt;td&gt;$x == $y&lt;/td&gt;  &lt;td&gt;false&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt; != &lt;/td&gt; &lt;td&gt;Not Equal To&lt;/td&gt;    &lt;td&gt;$x != $y&lt;/td&gt;  &lt;td&gt;true&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt; &lt; &lt;/td&gt; &lt;td&gt;Less Than&lt;/td&gt;     &lt;td&gt;$x &lt; $y &lt;/td&gt; &lt;td&gt;true&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt; &gt;&lt;/td&gt; &lt;td&gt;Greater Than&lt;/td&gt;    &lt;td&gt;$x &gt; $y &lt;/td&gt; &lt;td&gt;false&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt; &lt;= &lt;/td&gt;&lt;td&gt;Less Than or Equal To&lt;/td&gt;  &lt;td&gt;$x &lt;= $y &lt;/td&gt; &lt;td&gt;true&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td&gt; &gt;= &lt;/td&gt;&lt;td&gt;Greater Than or Equal To&lt;/td&gt; &lt;td&gt;$x &gt;= $y &lt;/td&gt; &lt;td&gt;false&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;String Operators&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The period "." is used to add two strings together. Example&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$a_string = "Hello";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$another_string = " vn4000";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$new_string = $a_string . $another_string;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo $new_string . "!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-2356681266516222689?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9aDIsQgt2Zgp3ROWosQmybgClrw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9aDIsQgt2Zgp3ROWosQmybgClrw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9aDIsQgt2Zgp3ROWosQmybgClrw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9aDIsQgt2Zgp3ROWosQmybgClrw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/GKi9ibr86KA/php-operators.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-operators.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-3048794607533840414</guid><pubDate>Mon, 01 Jun 2009 17:38:00 +0000</pubDate><atom:updated>2009-06-05T15:47:31.548-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - Strings</title><description>&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;String&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A string variable is used to store and manipulate text.&lt;br /&gt;The string, like a variable, will have to be created first. There are two ways to use a string in PHP – you can store it in a function or in a variable. In the example below, we will create a string twice – the first time storing it in a variable, and the second time – in a function, in our case – an echo.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$myString = "This is a string!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "This is a string!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo $myString;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Display:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is a string!This is a string!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;Single quotes and Double quotes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are two ways of quoting when you can specify a string in PHP – single quotes or double quotes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example for Single quotes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$my_string = 'Hello vn4000';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo 'Hello vn4000';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo $my_string;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example for double quotes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$my_string = "Hello vn4000";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "Hello vn4000";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo $my_string;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The two methods above are the traditional way to create strings in most programming languages.  PHP introduces a more robust string creation tool called &lt;i&gt;heredoc&lt;/i&gt; that lets the programmer create multi-line strings without using quotations.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$my_string = &amp;lt;&amp;lt;&amp;lt;TEXT&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;My&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;favorite&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;language&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;is&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;PHP&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;TEXT;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo $my_string;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-3048794607533840414?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uLrQQGCutnmFTKTM8zBvZB4SR2I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uLrQQGCutnmFTKTM8zBvZB4SR2I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uLrQQGCutnmFTKTM8zBvZB4SR2I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uLrQQGCutnmFTKTM8zBvZB4SR2I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/R8Rc0-Xg_o4/php-strings.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-strings.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-1695472288347078368</guid><pubDate>Mon, 01 Jun 2009 17:31:00 +0000</pubDate><atom:updated>2009-06-05T15:46:46.774-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP- Echo</title><description>To output a string,we use PHP echo&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$myString = "Hello everybody!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo $myString;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;echo "&amp;lt;b&amp;gt;I am learning PHP!&amp;lt;/b&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Display:&lt;br /&gt;&lt;br /&gt;Hello everybody!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;I am learning PHP!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-1695472288347078368?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/J85VdPgkofMopBhbd5Hb-SflCLg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J85VdPgkofMopBhbd5Hb-SflCLg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/J85VdPgkofMopBhbd5Hb-SflCLg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J85VdPgkofMopBhbd5Hb-SflCLg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/MT5wXXmrZGA/php-echo.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-echo.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-6380444808961777185</guid><pubDate>Mon, 01 Jun 2009 17:27:00 +0000</pubDate><atom:updated>2009-06-05T15:46:26.399-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP - Variables</title><description>In PHP you define a variable with the following form: &lt;ul style="font-weight: bold;"&gt;&lt;li&gt;$variable_name = Value;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you forget that dollar sign at the beginning, it will not work.  This is a common mistake for new PHP programmers!&lt;/p&gt;&lt;p&gt;Here is a example:&lt;/p&gt;&lt;p&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$hello = "Hello vn4000!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;$a_number = 400;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-6380444808961777185?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Fzr6YemdLny5clKB5D_x4QM9F0o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Fzr6YemdLny5clKB5D_x4QM9F0o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Fzr6YemdLny5clKB5D_x4QM9F0o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Fzr6YemdLny5clKB5D_x4QM9F0o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/oTm3oHMwVE0/php-variables.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-variables.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8566775542304208489.post-3608362223394399743</guid><pubDate>Mon, 01 Jun 2009 17:20:00 +0000</pubDate><atom:updated>2009-06-05T15:46:08.362-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Tutorials</category><title>PHP Syntax</title><description>All PHP code must be contained within the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or the Shorthand PHP Tag that requires shorthand support to be enabled on your server&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;&amp;lt;?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;the shorthand PHP tag &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;?&amp;gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8566775542304208489-3608362223394399743?l=vn4000.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aCHh4IcErFUxpT_DswtqI6QCSQ0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aCHh4IcErFUxpT_DswtqI6QCSQ0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aCHh4IcErFUxpT_DswtqI6QCSQ0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aCHh4IcErFUxpT_DswtqI6QCSQ0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://feedproxy.google.com/~r/Vn4000/~3/DfMoKi4pIU0/php-syntax.html</link><author>noreply@blogger.com (vn4000)</author><feedburner:origLink>http://vn4000.blogspot.com/2009/06/php-syntax.html</feedburner:origLink></item></channel></rss>

