<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6830606489310006988</id><updated>2011-12-07T04:15:38.309-08:00</updated><category term='TR tag'/><category term='php with forms'/><category term='Why Use PHP?'/><category term='Frame tag'/><category term='PHP scripting'/><category term='Form to Mail Script'/><category term='Arrays'/><category term='PRE tag'/><category term='Date and Time Functions'/><category term='INPUT tag'/><category term='HTTP and Mail Functions'/><category term='Array Functions:'/><category term='PHP Looping'/><category term='Email with PHP'/><category term='Text Formating tags'/><category term='PHP Functions and keywords'/><category term='CODE tag'/><category term='Variables'/><category term='Frameset tag'/><category term='XMP tag'/><category term='BLOCKQUOTE tag'/><category term='TABLE TAG'/><category term='Forms'/><category term='KBD tag'/><category term='Variable Functions'/><category term='FORM tag'/><category term='CITE tag'/><category term='TD tag'/><category term='TH tag'/><category term='AREA TAG'/><category term='php'/><category term='What Is PHP?'/><category term='Mathematical Functions'/><category term='The If Statement'/><category term='What is HTML'/><category term='Basic HTML Tags'/><category term='TT tag'/><category term='introduction to HTML'/><category term='ANCHOR tag'/><category term='structure of php'/><category term='DFN tag'/><category term='Frames'/><category term='PLAINTEXT tag'/><category term='SAMP tag'/><category term='Application Variables in PHP'/><category term='Final notes'/><category term='ADDRESS tag'/><category term='MAP tag'/><category term='IMAGE tag'/><category term='String Functions'/><category term='File system functions'/><title type='text'>htmlandphp</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-968307405088056814</id><published>2009-03-03T22:12:00.000-08:00</published><updated>2009-03-03T22:15:42.119-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='introduction to HTML'/><title type='text'>introduction to HTML</title><content type='html'>This collection of pages explains how to use the different HTML document description elements, or tags and how to use these elements to write good, well designed HTML documents. This particular page describes the overall content and organization of the material presented here, reviews some related resources that may be of interest, and describes the meanings of the navigational "buttons" you use to navigate from page to page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-968307405088056814?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/968307405088056814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/introduction-to-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/968307405088056814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/968307405088056814'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/introduction-to-html.html' title='introduction to HTML'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-5203440181836527916</id><published>2009-03-03T22:05:00.000-08:00</published><updated>2009-03-03T22:11:32.558-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is HTML'/><title type='text'>What is HTML</title><content type='html'>HTML are initials that stand for Hyper Text Markup Language&lt;br /&gt;&lt;br /&gt;    * Hyper is the opposite of linear. It used to be that computer programs had to move in a linear fashion. This before this, this before this, and so on. HTML does not hold to that pattern and allows the person viewing the World Wide Web page to go anywhere, any time they want.&lt;br /&gt;    * Text is what you will use. English letters, just like you use everyday..&lt;br /&gt;    * Markup is what you will do. You will write in plain English and then mark up what you wrote.&lt;br /&gt;    * Language. Some may argue that technically html is a code, but you write html in plain, everyday English language.&lt;br /&gt;&lt;br /&gt;HTML is the code behind your webpage and is what your browser looks for to display a webpage, the way the webdesigner intended it to look, and is a series of tags &lt;tags&gt; that tells the browser where to display what. It is really a series of simple commands that you give to the browser, just like telling your dog to sit, and because it is in plain English it is easy to learn. For example, if you want your text to show in a bold type, you command it &lt;bold&gt; to be bold text &lt;/bold&gt;, it really is that easy.&lt;br /&gt;&lt;br /&gt;Keep this in mind: HTML documents must be text only.&lt;br /&gt;When you save a HTML document, you must save only the text, nothing else. HTML browsers can only read text. Look at your keyboard. See the letters and numbers and little signs like % and @ and *? There are 128 in all (read upper- and lowercase letters as two). That's text. That's what the browser reads. It simply doesn't understand anything else.&lt;br /&gt;&lt;br /&gt;Remember that if you are using Notepad, Wordpad, or Simple Text, the document will be saved as text with no extra prompting. Just choose SAVE.&lt;br /&gt;&lt;br /&gt;If you are going to start learning to write HTML, it is a good idea to learn to look at other authors' HTML pages. The actual html potion of the page behind the pretty page you see in front of you now.&lt;br /&gt;&lt;br /&gt;Looking at another's html code helps you learn how things are done and you can copy the style of pages that you like. Please do not just steal and copy the pages, but no one will be upset if you make the style in much the same way. For example, if you were going to build a house, you would look around to see what styles you like before deciding on your own design. Same thing here, look around the web and see what styles you like and apply them to your own ideas.&lt;br /&gt;&lt;br /&gt;Here's how you look at an HTML document (known as the "source code")&lt;br /&gt;&lt;br /&gt;    * When you find a page you like, click on VIEW at the top of the screen.&lt;br /&gt;    * Choose SOURCE from the menu.&lt;br /&gt;    * The HTML document will appear on the screen. &lt;br /&gt;&lt;br /&gt;Try it with this page. Click on VIEW and then choose the SOURCE.&lt;br /&gt;It will look like mumbo jumbo right now, but soon it'll be readable and you'll be able to find exactly how a certain HTML presentation was performed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What are HTML Tags?&lt;br /&gt;&lt;br /&gt;HTML works in a very simple, very logical, format. It reads like you do, top to bottom, left to right. HTML is written with TEXT. What you use to set certain sections apart as bigger text, smaller text, bold text, underlined text, is a series of tags.&lt;br /&gt;&lt;br /&gt;Think of tags as commands. For example if you want a line of text to be bold. You will put a tag at the exact point you want the bold lettering to start &lt;bold&gt;and another tag where you want the bold lettering to stop.&lt;/bold&gt; There you have an example of how tags make commands and tell the browser how to display the text. Just like telling a dog to sit. You give the command.&lt;br /&gt;&lt;br /&gt;All tags that are opened must correspondingly be closed, just as if you are writing a quoted statement with those "inverted commas". A tag is closed this way &lt;/tag&gt; therefore we open a new tag &lt;bold&gt; and close the tag &lt;/bold&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-5203440181836527916?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/5203440181836527916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/what-is-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/5203440181836527916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/5203440181836527916'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/what-is-html.html' title='What is HTML'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-5525596424948509913</id><published>2009-03-03T21:48:00.000-08:00</published><updated>2009-03-03T22:05:01.420-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic HTML Tags'/><title type='text'>Basic HTML Tags</title><content type='html'>&lt;span style="font-weight:bold;"&gt;What Is a Tag?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    * A tag is a method of formatting HTML documents.&lt;br /&gt;&lt;br /&gt;    * With tags you can create italic or bold characters, make things blink, and can control the color and size of the lettering.&lt;br /&gt;&lt;br /&gt;    * Tags can be "nested". This means that you can make something bold and italic and green and blinking by simply surrounding the previous tag with the next.&lt;br /&gt;&lt;br /&gt;    * Tags can be used to insert pictures and graphics.&lt;br /&gt;&lt;br /&gt;    * Tags can be used to create bulleted lists like this one, or numbered lists.&lt;br /&gt;&lt;br /&gt;    * Tags look something like this: &lt;b&gt; chosen text &lt;/b&gt; .&lt;br /&gt;&lt;br /&gt;    * All tags use the &lt; and &gt; (less-than and greater-than symbols) to signal the browser. These are located above the comma and period keys.&lt;br /&gt;&lt;br /&gt;    * Within a tag, capitalization doesn't matter. FONT is the same as font or Font . I usually don't bother capitalizing when I use tags. Below, I have used capital letters when I felt that the number "1" and the letter "l" might be confused.&lt;br /&gt;&lt;br /&gt;    * It is essential to always close the tags! If not, the formatting will contaminate everything that follows it. But don't panic, closing tags is very easy, and even the most experienced surfers sometimes forget.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Italics&lt;/span&gt;&lt;br /&gt;To make italics surround the chosen text with these tags:&lt;br /&gt;&lt;br /&gt;&lt;i&gt; chosen text &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The "/i" tag is essential; this will close the tag and stop the italics. If this is not done, all the text which follows the first, i , tag will appear italicized.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Bold Lettering&lt;/span&gt;&lt;br /&gt;To make letters bold surround the chosen text with these tags:&lt;br /&gt;&lt;br /&gt;&lt;b&gt; chosen text &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The "/b" tag is essential; this will close the tag and stop the bold lettering. If this is not done, all the text which follows the first, b , tag will appear in bold.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Changing Font Size&lt;/span&gt;&lt;br /&gt;There are three different ways to change the size of the font. Method 1, Method 2, and Method 3.&lt;br /&gt;Also see below on how to change both the size and the color of the font at the same time.&lt;br /&gt;&lt;br /&gt;   1. The first method is to use the "big" and "small" tags.&lt;br /&gt;&lt;br /&gt;      For example, to increase the font by one degree surround the text with the following tags:&lt;br /&gt;&lt;br /&gt;      &lt;big&gt; chosen text &lt;/big&gt;&lt;br /&gt;&lt;br /&gt;      If you want to make it even bigger, you surround it again:&lt;br /&gt;&lt;br /&gt;      &lt;big&gt; &lt;big&gt; chosen text &lt;/big&gt; &lt;/big&gt;&lt;br /&gt;&lt;br /&gt;      To make the font small, surround it with the small tag:&lt;br /&gt;&lt;br /&gt;      &lt;small&gt; chosen text &lt;/small&gt;&lt;br /&gt;&lt;br /&gt;      If you want to make it even smaller, surround it with the tag again:&lt;br /&gt;&lt;br /&gt;      &lt;small&gt; &lt;small&gt; chosen text &lt;/small&gt; &lt;/small&gt;&lt;br /&gt;&lt;br /&gt;      The "/big" and "/small" tags are essential; they will close the tag and stop the special formatting. If this is not done, all the text which follows the first, &lt;big&gt; or &lt;small&gt; , tag will appear in the altered size.&lt;br /&gt;&lt;br /&gt;   2. The second method is to directly change the font size.&lt;br /&gt;&lt;br /&gt;      You can use + and - along with a number to shrink and grow the font:&lt;br /&gt;&lt;br /&gt;      &lt;font size=+2&gt; chosen text &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;      &lt;font size=+1&gt; chosen text &lt;/font&gt; .........(same as &lt;big&gt; )&lt;br /&gt;&lt;br /&gt;      &lt;font size=+0&gt; chosen text &lt;/font&gt; .........(plain text)&lt;br /&gt;&lt;br /&gt;      &lt;font size=-1&gt; chosen text &lt;/font&gt; .........(same as &lt;small&gt; )&lt;br /&gt;&lt;br /&gt;      &lt;font size=-2&gt; chosen text &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;      Notice that when you get to larger fonts they tend to appear bold.&lt;br /&gt;&lt;br /&gt;      The " /font " tag is essential; it will close the tag and define the end of the specialized formatting. If this is not done, all the text which follows the first, font size= , tag will appear in the altered size.&lt;br /&gt;&lt;br /&gt;   3. The third method is to use what are called headers.&lt;br /&gt;&lt;br /&gt;      Headers are abbreviated with the letter "h" and a number from 1 to 6. For example:&lt;br /&gt;&lt;br /&gt;      &lt;h5&gt; chosen text &lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;      Along with the tag, I will demonstrate the result for each:&lt;br /&gt;&lt;br /&gt;      &lt;h1&gt; chosen text &lt;/h1&gt;&lt;br /&gt;      &lt;h2&gt; chosen text &lt;/h2&gt;&lt;br /&gt;      &lt;h3&gt; chosen text &lt;/h3&gt;&lt;br /&gt;      &lt;h4&gt; chosen text &lt;/h4&gt;&lt;br /&gt;      &lt;h5&gt; chosen text &lt;/h5&gt;&lt;br /&gt;      &lt;h6&gt; chosen text &lt;/h6&gt;&lt;br /&gt;&lt;br /&gt;      Notice that the header method also utilizes a bold font. &lt;br /&gt;&lt;br /&gt;The "/h# " tag is essential; it will close the tag and define the end of the specialized formatting. If this is not done, all the text which follows the first, &lt;h#&gt; , tag will appear in the altered size.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Blinking Text&lt;/span&gt;&lt;br /&gt;To make text blink surround the chosen text with these tags:&lt;br /&gt;&lt;br /&gt;&lt;blink&gt; chosen text &lt;/blink&gt;&lt;br /&gt;&lt;br /&gt;Note: This will not show up if you are using Microsoft Explorer (Blame it on Bill Gates!).&lt;br /&gt;&lt;br /&gt;The "/blink" tag is essential; this will close the tag and signal the end of the special formatting. If this is not done, all the text which follows the first, &lt;blink&gt; , tag will blink.&lt;br /&gt;&lt;br /&gt;Use this sparingly, it can get a bit obnoxious if used overfrequently.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Changing Text Color&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To change the color of the text surround the chosen text with the following tags:&lt;br /&gt;&lt;br /&gt;&lt;font color="color name"&gt; chosen text &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;The "/font" tag is essential; this will close the tag and signal the end of the colored text. If this is not done, all the text which follows the first, font color= , tag will appear in the altered color.&lt;br /&gt;&lt;br /&gt;The "color name" can be one of two things. If you only want to use a common color, you can simply put in the name of that color. This works for the following colors:&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;  Black   &lt;/font&gt;&lt;br /&gt;&lt;font color="white"&gt;  White  (White)  &lt;/font&gt;&lt;br /&gt;&lt;font color="yellow"&gt;  Yellow  (Yellow)  &lt;/font&gt;&lt;br /&gt;&lt;font color="orange"&gt;  Orange   &lt;/font&gt;&lt;br /&gt;&lt;font color="pink"&gt;  Pink  (Pink)  &lt;/font&gt;&lt;br /&gt;&lt;font color="red"&gt;  Red   &lt;/font&gt;&lt;br /&gt;&lt;font color="green"&gt;  Green   &lt;/font&gt;&lt;br /&gt;&lt;font color="blue"&gt;  Blue   &lt;/font&gt;&lt;br /&gt;&lt;font color="purple"&gt;  Purple   &lt;/font&gt;&lt;br /&gt;&lt;font color="cyan"&gt;  Cyan  (Cyan)  &lt;/font&gt;&lt;br /&gt;&lt;font color="magenta"&gt;  Magenta   &lt;/font&gt;&lt;br /&gt;&lt;font color="maroon"&gt;  Maroon   &lt;/font&gt;&lt;br /&gt;&lt;font color="brown"&gt;  Brown   &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;The second thing you can use as a "color name" is a numeric code for the color. This allows you to fine tune the color more than you can with the fixed colors listed above. For example you can have a deeper shade of blue, or a lighter brown.&lt;br /&gt;&lt;br /&gt;To use this option you type:&lt;br /&gt;&lt;br /&gt;&lt;font color="#rrggbb"&gt; chosen text &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Where "#rrggbb" is the code for a color. Don't forget the quotation marks or the # sign--they are necessary.&lt;br /&gt;&lt;br /&gt;The "/font" tag is essential; this will close the tag and signal the end of the colored text. If this is not done, all the text which follows the first, font color= , tag will appear in the altered color.&lt;br /&gt;&lt;br /&gt;Here is a short list of some of basic colors:&lt;br /&gt;&lt;br /&gt;Here is a yellow color whose hex-code number is-- # f f f f 0 0 . (# f f f f 0 0)&lt;br /&gt;&lt;br /&gt;Here is a red color whose hex-code number is-- # f f 0 0 0 0 . (# f f 0 0 0 0)&lt;br /&gt;&lt;br /&gt;Here is a green color whose hex-code number is-- # 0 0 f f 0 0 . (# 0 0 f f 0 0)&lt;br /&gt;&lt;br /&gt;Here is a light-blue color whose hex-code number is-- # 0 0 f f f f . (# 0 0 f f f f)&lt;br /&gt;&lt;br /&gt;Here is another blue color whose hex-code number is-- # 1 f 8 1 a 6 . (# 1 f 8 1 a 6)&lt;br /&gt;&lt;br /&gt;Here is a blue color whose hex-code number is-- # 0 0 0 0 f f . (# 0 0 0 0 f f)&lt;br /&gt;&lt;br /&gt;Here is a purple color whose hex-code number is-- # f f 0 0 f f . (# f f 0 0 f f)&lt;br /&gt;&lt;br /&gt;For a more complete list of colors, here is a chart with their hex-code names:&lt;br /&gt;&lt;br /&gt;Color Chart&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Changing Text Font&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Changing the font of text online is one of the most frustrating parts of formatting for the web, because you never know what the person on the other end is going to see.&lt;br /&gt;&lt;br /&gt;The reason for this is that the fonts you choose to use must already be loaded on the other person's computer. If they aren't, then they will just see their default font.&lt;br /&gt;&lt;br /&gt;For example, if you really, really want to use "Tigerteeth ICG", because you think it looks great and is perfect for your site, you probably shouldn't bother. Few people will have "Tigerteeth" loaded on their machine, and only those who do will see it--everyone else will just see their default font (usually something like Times New Roman). To make matters even more complicated, Mac users will usually have a completely different set of fonts, so you need to think of them when choosing your font. There seems to be little or no standardization of fonts, some machines will contain one set, while another could have a very different set.&lt;br /&gt;&lt;br /&gt;So, is it hopeless? Not entirely. If you want to use a really fancy font, which may be rare, or which you might have downloaded from a font website, then don't bother or find another way. But if you want to use a fixed-width font instead of a varying one, or if you want to use a sans serif font (one without those tiny little cross pieces which finish off letters) instead of one with them, you can do it. In other words, if you want a bit of a change, but aren't particular about what that change is, go ahead.&lt;br /&gt;&lt;br /&gt;If you want to use less common fonts, you can go ahead and do so. The trick then is to pick several different fonts and use them all. This is similar to choosing the font you most want, then the second most-wanted one, then the third most-wanted, etc. When someone views your page, if they have the first font, that's what they'll see. If they don't, then they might have the second, and that is what they'll see. If not the second, then maybe they will have the third. With several fonts listed, you increase the possiblity that the other person will at least have one of them.&lt;br /&gt;&lt;br /&gt;So, here's how to do it. Surround the chosen text with the following tags:&lt;br /&gt;&lt;br /&gt;&lt;font face="font name 1, font name 2, font name 3"&gt; chosen text &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Notice where the quotation marks are--outside the entire list of fonts, not around each font.&lt;br /&gt;&lt;br /&gt;The "/font" tag is essential; this will close the tag and signal the end of the colored text. If this is not done, all the text which follows the first, font face= , tag will appear in the altered font.&lt;br /&gt;&lt;br /&gt;The "font name" is the name of the font, for example: Times New Roman, Arial, Verdana, Helvetica, or sans serif.&lt;br /&gt;&lt;br /&gt;Examples:&lt;br /&gt;&lt;br /&gt;&lt;font face="Verdana, Arial, Helvetica, sans serif" size=2&gt;"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."&lt;br /&gt;&lt;br /&gt;--Jane Austen, Pride and Prejudice&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font face="Lucida Calligraphy, Lucida Handwriting, WhisperWrite, Brush Script MT" size=4 color=008080&gt; Pride and Prejudice and Sense and Sensibility. &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Now, what if you really, really, really want to use a fancy font?&lt;br /&gt;&lt;br /&gt;Well, if you have a large section of text, you might want to give up, but if you want to use a fancy font for titles on your page, or to make a small part of your page stand out, then you may try to use an image program to turn them into pictures:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Baronetage&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One thing to keep in mind with images is the length of time they take to load into someone's browser. An entire page shouldn't be longer than about 75 KBs, text and images included. So, if you want to use a large image you will have little left for other items on the page. The image I just used above is about 4 KBs, so it won't take long to load and isn't a problem.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Nesting Tags&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As can be seen above in the first method for changing font size, tags can be used together, or "nested".&lt;br /&gt;&lt;br /&gt;For example, to make something both bold and italic use the following tags:&lt;br /&gt;&lt;br /&gt;&lt;b&gt; &lt;i&gt; chosen text &lt;/i&gt; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;or big and red:&lt;br /&gt;&lt;br /&gt;&lt;font color="#ff0000"&gt; &lt;big&gt;chosen text &lt;/big&gt; &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;If you want to change both the color and the size of the font at the same time, it is easiest to do both in the same tag. For example:&lt;br /&gt;&lt;br /&gt;&lt;font size=+2 color="#0000ff"&gt; chosen text &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;As you can see, both the color and the size tags can be combined into one, when you use the &lt;font&gt; tag. It does not matter what order you use,  &lt;br /&gt;&lt;br /&gt;Of course, you can add a font too:&lt;br /&gt;&lt;br /&gt;&lt;font size=+2 color="#0000ff" face="verdana, arial, helvetica, sans serif"&gt; chosen text &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Again don't forget the &lt;/font&gt; to close the tag.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How To Draw A Line Across The Screen&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this tutorial the different sections are divided by lines, or rules or bars, which cross the entire screen. This is very easy to do and needs only a single tag (no closing tag is necessary).&lt;br /&gt;&lt;br /&gt;To draw a line across the page type:&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;this stands for "horizontal rule", and the result will look like:&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;I have added a blank space above and below the horizantal rule, but usually the text would appear directly above&lt;br /&gt;and below the line without any extra space, as I have just shown.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;You can modify the bar in several ways.&lt;br /&gt;&lt;br /&gt;You can make the line go across only a part of the page by specifying the width with a percentage, where 100% would mean the bar goes across the entire screen, smaller percentages make the line cross less of the screen:&lt;br /&gt;&lt;br /&gt;&lt;hr width=75%&gt;&lt;br /&gt;&lt;br /&gt;results in:&lt;br /&gt;&lt;br /&gt;You can make the line thicker by specifying the size of the bar; the larger the number the wider the bar:&lt;br /&gt;&lt;br /&gt;&lt;hr size=10&gt;&lt;br /&gt;&lt;br /&gt;Results in:&lt;br /&gt;&lt;br /&gt;You can also make the bar look solid by adding the word "noshade" to the tag:&lt;br /&gt;&lt;br /&gt;&lt;hr size=10 noshade&gt;&lt;br /&gt;&lt;br /&gt;Results in:&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;&lt;hr noshade&gt;&lt;br /&gt;&lt;br /&gt;Results in:&lt;br /&gt;&lt;br /&gt;If you use the width command to specify how much of the screen the bar will cross, then you can also tell the browser where you want the bar to appear: in the center of the screen, to the left or to the right. If you do not specify where you want the bar to appear, it will appear centered in the screen. This can be done with by adding "align=" to the tag:&lt;br /&gt;&lt;br /&gt;&lt;hr width=50% align=left&gt;&lt;br /&gt;&lt;br /&gt;results in:&lt;br /&gt;&lt;br /&gt;&lt;hr width=50% align=center&gt;&lt;br /&gt;&lt;br /&gt;results in:&lt;br /&gt;&lt;br /&gt;&lt;hr width=50% align=right&gt;&lt;br /&gt;&lt;br /&gt;results in:&lt;br /&gt;&lt;br /&gt;Again, the &lt;hr&gt; tag is a very easy one, because you only need to put in a single tag and you do not need a second one to close the first.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How To Add Graphic Smiley Faces and Images&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you wish to add graphics such as or , the tag looks a bit complicated but I will try to explain it.&lt;br /&gt;&lt;br /&gt;First, here is what the tag for the yellow smiley-face looks like:&lt;br /&gt;&lt;br /&gt;= &lt;IMG SRC="http://www.austen.com/tutorial/smiley.gif"&gt;&lt;br /&gt;&lt;br /&gt;What this means:&lt;br /&gt;&lt;br /&gt;    * IMG -- This stands for "image" and tells the browser that you are putting in a picture.&lt;br /&gt;&lt;br /&gt;    * SRC -- This stands for "source" and refers to the location on the internet where the browser can find the image. (As said above, capitalization is unnecessary.)&lt;br /&gt;&lt;br /&gt;    * http://www.austen.com/tutorial/ -- This is the location on the internet of the computer and directory in which the picture is stored.&lt;br /&gt;&lt;br /&gt;    * smiley.gif -- Is the name of the actual file for&lt;br /&gt;      frown.gif -- is the name of the actual file for .&lt;br /&gt;&lt;br /&gt;    * Notice that this tag stands alone, you do not need a second tag to close the first.&lt;br /&gt;&lt;br /&gt;Note: The quotation marks around the file location (http etc.) are essential!&lt;br /&gt;&lt;br /&gt;So the tag for pictures is: &lt;img src="internet location"&gt; , where "internet location" is the web address of the picture. This works with any picture or graphic on the web, not just those listed here.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How To Copy The Location Of An Image&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you see a picture somewhere on the web that you would like to use, and if you are using Netscape, you can automatically copy the location of the image. That is to say you can copy a location, such as http://www.austen.com/tutorial/smiley.gif, so that you can paste it into the tag without typing it all out. If you are using MSExplorer, it is not such a simple thing to do (blame it on Bill Gates!) .&lt;br /&gt;&lt;br /&gt;Here, I will show what to do in the case of Netscape (it differs slightly depending on whether you live in the Mac world or the PC world).&lt;br /&gt;&lt;br /&gt;    * For PC users,&lt;br /&gt;&lt;br /&gt;         1. Point at the image you want to use, and&lt;br /&gt;         2. Click the right mouse button (not the left, the right mouse button).&lt;br /&gt;         3. This will cause a menu to appear. One of the options in the menu is "Copy Image Location".&lt;br /&gt;         4. If you sellect this option, you can then paste the location (such as http://www.austen.com/tutorial/smiley.gif) into your tag. &lt;br /&gt;&lt;br /&gt;    * For Mac users,&lt;br /&gt;&lt;br /&gt;         1. Point at the image you want to use, and&lt;br /&gt;         2. Click and hold down the mouse button.&lt;br /&gt;         3. This will cause a menu to appear. One of the options in the menu is "Copy Image Location".&lt;br /&gt;         4. If you sellect this option, you can then paste the location (such as http://www.austen.com/tutorial/smiley.gif) into your tag. &lt;br /&gt;&lt;br /&gt;If you are using MSExplorer, the best way to find the URL, is to use load the image on its own page. Use the same methods listed for Netscape, but choose the "View Image" option. Once the image is loaded all by itself onto the browser, the "Location" line at the very top of the page will contain the full URL. You can highlight it and copy it from there, then paste it wherever you want.&lt;br /&gt;&lt;br /&gt;Pictures on the web are sometimes copyrighted, so you should be careful to make sure that they are available for general use, or you have permission from the owner to use them. All of the graphics listed here can be used freely.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Advanced Graphics Information&lt;/span&gt;&lt;br /&gt;For more advanced information of manipulating the appearence of a graphic on a page, see Manipulating Graphics With Text&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How To Make a Link To Another Web Site&lt;/span&gt;&lt;br /&gt;Making a link, such as Jane Austen Information Page, is very similar to inserting a graphic. One major difference is that there must be a second tag to close the first one. The Jane Austen link I just used looks like:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pemberley.com/janeinfo/janeinfo.html"&gt;Jane Austen Information Page&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The first tag consists of three basic parts:&lt;br /&gt;&lt;br /&gt;   1. The a stands for "anchor", and is the term used in HTML to refer to links.&lt;br /&gt;&lt;br /&gt;   2. The href stands for "hypertext-reference" (I think), and tells the browser you are making a link to another web site.&lt;br /&gt;&lt;br /&gt;   3. As in the case of graphics, the full internet location of the web site you are refering to is then inserted in quotation marks after an =. The web address, http://www.pemberley.com/janeinfo/janeinfo.html, is the location of Henry Churchyard's Jane Austen page. The address for the page you are currently looking at is (probably) http://www.austen.com/tutorial/index.html.&lt;br /&gt;&lt;br /&gt;Once this first tag is complete, anything typed after it will appear as an underlined link until you insert the second, closing, tag /a. For example, I could write the above link as&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pemberley.com/janeinfo/janeinfo.html"&gt;Henry's Jane Austen Page &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pemberley.com/janeinfo/janeinfo.html"&gt;Hey guys! Click here &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you do not close the tag, with the                                                                /a                                                                                                                                                                                                                                                                                                                                                                                    , then everything that follows will appear as an underlined link.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How To Indent a Section Of Text&lt;/span&gt;&lt;br /&gt;Sometimes when quoting text or when you want to set one section of the text apart from the rest, it is useful to be able to indent it. This technique is used frequently in writing to denote long passages of quoted material. To indent a block of text surround it with the tags:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;chosen text&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The blockquote tag also automatically inserts a blank line above and below the chosen text.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;    &lt;blockquote&gt;"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;--Jane Austen, Pride and Prejudice&lt;br /&gt;&lt;br /&gt;Once again it is very important to stop the indentation with the /blockquote tag.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How To Center a Section Of Text&lt;/span&gt;&lt;br /&gt;Being able to center text or images comes in handy.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;chosen text&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;The center tag also automatically inserts a blank line above and below the chosen text.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;center&gt;"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."&lt;/center&gt;&lt;br /&gt;--Jane Austen, Pride and Prejudice&lt;br /&gt;&lt;br /&gt;Once again it is very important to stop the centering with the /center tag.&lt;br /&gt;&lt;br /&gt;How To Right-Justify a Section Of Text&lt;br /&gt;Since we're doing paragraph formatting, let's do right-justifying. This one is a little different, since it uses the &lt;p&gt; tag to make the formatting.&lt;br /&gt;&lt;br /&gt;&lt;p align=right&gt;chosen text&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;The big thing to notice here is that the paragraph tag must be opened and closed like other tags (usually you don't need to close a paragraph tag, but here you do, since you have to tell the browser when to stop the formatting.)&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;p align=right&gt;"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;--Jane Austen, Pride and Prejudice&lt;br /&gt;&lt;br /&gt;Once again it is very important to stop the justification with the &lt;/p&gt; tag.&lt;br /&gt;&lt;br /&gt;As you might be able to guess, this works with align=center as well as align=right.&lt;br /&gt;&lt;br /&gt;In addition, you can justify both sides of text by using align=justify. This will cause the browser to space the words differently, so that they line up with the right margin:&lt;br /&gt;&lt;br /&gt;&lt;p align=justify&gt;"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;--Jane Austen, Pride and Prejudice&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;How To Make Bulleted Lists&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   1. First you must tell the browser you are making an unnumbered list by typing:&lt;br /&gt;&lt;br /&gt;      &lt;UL&gt;&lt;br /&gt;&lt;br /&gt;   2. Then you must denote the start of each item in the list by typing:&lt;br /&gt;&lt;br /&gt;      &lt;LI&gt;&lt;br /&gt;&lt;br /&gt;      in front of the item.&lt;br /&gt;&lt;br /&gt;   3. Then you must tell the browser that the list is complete by closing the list tag:&lt;br /&gt;&lt;br /&gt;      &lt;/UL&gt; &lt;br /&gt;&lt;br /&gt;Notice that the &lt;LI&gt; tags do not need to be closed.&lt;br /&gt;&lt;br /&gt;Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;UL&gt;&lt;br /&gt;&lt;br /&gt;&lt;LI&gt; Item one on list.&lt;br /&gt;&lt;br /&gt;&lt;LI&gt; Item two on list.&lt;br /&gt;&lt;br /&gt;&lt;LI&gt; Item three on list.&lt;br /&gt;&lt;br /&gt;&lt;/UL&gt;&lt;br /&gt;&lt;br /&gt;Results in the following list:&lt;br /&gt;&lt;br /&gt;    * Item one on list.&lt;br /&gt;    * Item two on list.&lt;br /&gt;    * Item three on list. &lt;br /&gt;&lt;br /&gt;Notice that the list is automatically indented.&lt;br /&gt;&lt;br /&gt;You can also specify what type of bullet you want to use:&lt;br /&gt;&lt;br /&gt;    * If you want to use a hollow circle, add to the starting tag: type=circle, so it looks like UL type=circle. &lt;br /&gt;&lt;br /&gt;    * If you want to use a filled square, add to the starting tag: type=square, so it looks like UL type=square. &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;How To Make Numbered Lists&lt;/span&gt;&lt;br /&gt;The method for making numbered lists is identical to that for bulleted lists. The only difference is that instead of an unnumbered list (UL) it is an ordered list (OL). So just replace the "UL's" in the last section with "OL's" and you have it:&lt;br /&gt;&lt;br /&gt;Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;OL&gt;&lt;br /&gt;&lt;br /&gt;&lt;LI&gt; Item one on list.&lt;br /&gt;&lt;br /&gt;&lt;LI&gt; Item two on list.&lt;br /&gt;&lt;br /&gt;&lt;LI&gt; Item three on list.&lt;br /&gt;&lt;br /&gt;&lt;/OL&gt;&lt;br /&gt;&lt;br /&gt;Results in the following list:&lt;br /&gt;&lt;br /&gt;   1. Item one on list.&lt;br /&gt;   2. Item two on list.&lt;br /&gt;   3. Item three on list. &lt;br /&gt;&lt;br /&gt;Again the list is automatically indented.&lt;br /&gt;&lt;br /&gt;It is also possible to change the style of the numbers from 1. 2. 3., to A. B. C., a. b. c., I. II. III., or i. ii. iii.&lt;br /&gt;&lt;br /&gt;   1. For capital letters add type=A to the starting tag: OL type=A. &lt;br /&gt;&lt;br /&gt;   1. For lower-case letters add type=a to the starting tag: OL type=a. &lt;br /&gt;&lt;br /&gt;   1. For capital Roman numerals add type=I to the starting tag: OL type=I. &lt;br /&gt;&lt;br /&gt;   1. For lower-case Roman numerals add type=i to the starting tag: OL type=i. &lt;br /&gt;&lt;br /&gt;Note: This is one of the few cases in HTML where capitilization is necessary: types "A" and "a" give different results, and "I" and "i" give different results.&lt;br /&gt;&lt;br /&gt;For example (I'll only show one of these):&lt;br /&gt;&lt;br /&gt;&lt;OL type=i&gt;&lt;br /&gt;&lt;LI&gt; Item one on list.&lt;br /&gt;&lt;LI&gt; Item two on list.&lt;br /&gt;&lt;LI&gt; Item three on list.&lt;br /&gt;&lt;/OL&gt;&lt;br /&gt;&lt;br /&gt;Results in the following list:&lt;br /&gt;&lt;br /&gt;   1. Item one on list.&lt;br /&gt;   2. Item two on list.&lt;br /&gt;   3. Item three on list. &lt;br /&gt;&lt;br /&gt;Using these techniques and by nesting the lists, it is possible to create outlines:&lt;br /&gt;&lt;br /&gt;   1. Introduction&lt;br /&gt;   2. The Basics&lt;br /&gt;         1. What is an HTML tag?&lt;br /&gt;               1. Formatting text&lt;br /&gt;               2. Syntax&lt;br /&gt;                     1. Uses &lt;and&gt;&lt;br /&gt;                     2. Usually used in pairs.&lt;br /&gt;                     3. The second tag closes the first &lt;br /&gt;               3. Capitalization &lt;br /&gt;         2. Italics&lt;br /&gt;         3. Bold&lt;br /&gt;         4. Size of font&lt;br /&gt;               1. Font attribute&lt;br /&gt;               2. Headers&lt;br /&gt;               3. Big and Small attributes &lt;br /&gt;         5. Color of font &lt;br /&gt;   3. Advanced&lt;br /&gt;         1. Inserting Graphics&lt;br /&gt;         2. Inserting Links &lt;br /&gt;   4. Conclusion&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-5525596424948509913?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/5525596424948509913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/basic-html-tags.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/5525596424948509913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/5525596424948509913'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/basic-html-tags.html' title='Basic HTML Tags'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-4450090416412919810</id><published>2009-03-03T21:40:00.000-08:00</published><updated>2009-03-03T21:43:32.612-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Text Formating tags'/><title type='text'>Text Formating tags</title><content type='html'>Getting text into your web page is quite easy - just start typing between the two BODY tags. When you save your work and view it in a browser, the text will appear without any special formatting. You don't need to specify a type of font to use, or a colour, or a size. This is because browsers are set up to use defaults when no instructions are given.&lt;br /&gt;&lt;br /&gt;Text formatting, in html terms, is when you give the browser instructions on how your text should look. These instructions come in the form of tags, and you'll learn these now.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Colour&lt;br /&gt;&lt;br /&gt;You can specify which colour you want to use for all the text on your web page. The browser default is black, so you only really need to specify a colour if you don't want black. Here's how to do it.&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      Start your HTML Editor&lt;br /&gt;    *&lt;br /&gt;      Click File &gt; New&lt;br /&gt;    *&lt;br /&gt;      Set a background colour and click OK&lt;br /&gt;    *&lt;br /&gt;      When you see the code, locate the first BODY tag&lt;br /&gt;    *&lt;br /&gt;      Click your cursor after the "Y" of BODY&lt;br /&gt;    *&lt;br /&gt;      Press the spacebar on your keyboard&lt;br /&gt;    *&lt;br /&gt;      Type in TEXT =&lt;br /&gt;    *&lt;br /&gt;      Then type a colour for your text&lt;br /&gt;    *&lt;br /&gt;      In between the two BODY tags, start typing you text&lt;br /&gt;    *&lt;br /&gt;      Save your web page, and then view the results&lt;br /&gt;    *&lt;br /&gt;      In the code below, the text has been set to Blue&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;If all you want to do is to change the colour of some text between the BODY tags, your HTML editor has a quick way of doing that.&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      Highlight the text whose colour you want to change&lt;br /&gt;    *&lt;br /&gt;      From the menu bar, click on Format &gt; Text Colour&lt;br /&gt;    *&lt;br /&gt;      The Colour dialogue box appears&lt;br /&gt;    *&lt;br /&gt;      Choose a colour by clicking on a colour square&lt;br /&gt;    *&lt;br /&gt;      Click OK&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Headings&lt;br /&gt;&lt;br /&gt;You've already met the Headings tag. If you'll remember, the Heading tag uses the letter "H" followed by a number. Like this:&lt;br /&gt;&lt;br /&gt;&lt;H1&gt;My Heading&lt;/H1&gt;&lt;br /&gt;&lt;br /&gt;or like this:&lt;br /&gt;&lt;br /&gt;&lt;H4&gt;My Heading&lt;/H4&gt;&lt;br /&gt;&lt;br /&gt;The heading tag increases or decreases text size above or below the default size. The default size is 3. The biggest size is 1, and the smallest 7.&lt;br /&gt;&lt;br /&gt;The heading tag will automatically insert a line break for you, so you don't have to insert a &lt;P&gt; or &lt;BR&gt; tag after it to start a new line.&lt;br /&gt;&lt;br /&gt;To insert a Heading tag with the HTML Editor, click on Insert &gt; Heading then choose a Heading size. Only size 1 to 4 are used in the editor. But bear in mind, you can go as low as size 7.&lt;br /&gt;&lt;br /&gt;When you click on a heading size, the beginning and end Tag will be inserted with the cursor flashing between the two:&lt;br /&gt;&lt;br /&gt;&lt;H1&gt; &lt;/H1&gt;&lt;br /&gt;&lt;br /&gt;The forward slash, remember, tells the browser to stop formatting a tag. In this case, stop formatting the H1 heading tag.&lt;br /&gt;&lt;br /&gt;With the cursor flashing between the two tags, type your text for the heading.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Centring Text&lt;br /&gt;&lt;br /&gt;To centre text (and anything else on your page), the CENTER tag is used. Note the American spelling, with "ER" at the end and not "RE". To centre something with the HTML Editor, do the following:&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      Highlight whatever you want to centre&lt;br /&gt;    *&lt;br /&gt;      From the menu bar, click on Format &gt; Centre&lt;br /&gt;    *&lt;br /&gt;      The two CENTER tags will surround your highlighted text&lt;br /&gt;    *&lt;br /&gt;      Save your work and view the results in your browser&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this lesson, we'll continue our look at the basic text formatting tags available to you in HTML&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Bold Text&lt;br /&gt;&lt;br /&gt;You can make text stand out by using the bold tag.&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      In your Editor, highlight the text you want to make bold&lt;br /&gt;    *&lt;br /&gt;      From the menu bar, click on Format &gt; Bold&lt;br /&gt;    *&lt;br /&gt;      The two &lt;B&gt;&lt;/B&gt; tags will surround your highlighted text&lt;br /&gt;    *&lt;br /&gt;      Save your work and view the results in your browser&lt;br /&gt;&lt;br /&gt;Bold Text&lt;br /&gt;Italics&lt;br /&gt;&lt;br /&gt;The HTML tag to make text italic is as simple as the "B" tag for bold text. With your HTML editor, do the following:&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      Highlight the text for the italics&lt;br /&gt;    *&lt;br /&gt;      From the menu bar, click on Format &gt; Italics&lt;br /&gt;    *&lt;br /&gt;      The two &lt;I&gt;&lt;/I&gt; tags will surround your highlighted text&lt;br /&gt;    *&lt;br /&gt;      Save your work and view the results in your browser&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Subscript&lt;br /&gt;&lt;br /&gt;Subscript is text that appears below normal text. Like this:&lt;br /&gt;&lt;br /&gt;50p&lt;br /&gt;&lt;br /&gt;You can have Subscript in your HTML code quite easily. To format text as subscript using your HTML editor, do this:&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      Highlight the text you want to turn into subscript&lt;br /&gt;    *&lt;br /&gt;      From the menu bar, click on Format &gt; Subscript&lt;br /&gt;    *&lt;br /&gt;      The two &lt;SUB&gt;&lt;/SUB&gt; tags will surround your highlighted text&lt;br /&gt;    *&lt;br /&gt;      Save your work and view the results in your browser&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Superscript&lt;br /&gt;&lt;br /&gt;Superscript is text that is raised slightly above the centre. Like this&lt;br /&gt;&lt;br /&gt;24th&lt;br /&gt;&lt;br /&gt;To format text as superscript using your HTML editor, do this:&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      Highlight the text you want to turn into superscript&lt;br /&gt;    *&lt;br /&gt;      From the menu bar, click on Format &gt; Superscript&lt;br /&gt;    *&lt;br /&gt;      The two &lt;SUP&gt;&lt;/SUP&gt; tags will surround your highlighted text&lt;br /&gt;    *&lt;br /&gt;      Save your work and view the results in your browser&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-4450090416412919810?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/4450090416412919810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/text-formating-tags.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4450090416412919810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4450090416412919810'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/text-formating-tags.html' title='Text Formating tags'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-4478864183598031819</id><published>2009-03-03T21:35:00.000-08:00</published><updated>2009-03-03T21:40:22.093-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PRE tag'/><title type='text'>PRE tag</title><content type='html'>HTML Pre Tag&lt;br /&gt;&lt;br /&gt;The HTML pre tags are used to define the HTML pre element. The HTML pre element begins with the HTML &lt;pre&gt; tag and ends with the HTML &lt;/pre&gt; tag. The HTML pre element is used to direct the browser to display a section of text exactly as it is typed with spaces and line feeds included.&lt;br /&gt;HTML Pre Element Attributes&lt;br /&gt;&lt;br /&gt;HTML "pre" element attributes include:&lt;br /&gt;&lt;br /&gt;    * width - (Depreciated). The "width" attribute specifies the number of characters across the screen to display. This is very rarely used. An example of its use is blockquote width="20"&lt;br /&gt;    * class - The class attribute is used in conjunction with style sheets to associate an element with a class. The class attribute can set a class for specific element types or it can be independent of element types and work for all elements. The class attribute will provide the settings for specific style formatting. CSS properties are shown at the CSS Properties page.&lt;br /&gt;    * ID - The ID attribute is used to apply style settings to specific individual HTML elements.&lt;br /&gt;    * style - The style attribute is used to apply style settings for the specific element the style attribute is included with. An example is" &lt;p style="font: 16pt courier"&gt; - This sets the style or color of the text. This statement starts a paragraph with color, green: &lt;p style="color: green"&gt;. The STYLE attribute is common to most HTML elements (See the CSS Properties page).&lt;br /&gt;    * title - Used to give specific elements a title which may appear as a tooltip in some browsers when the mouse is held at or near the element. &lt;br /&gt;&lt;br /&gt;HTML Pre Element Contents&lt;br /&gt;&lt;br /&gt;The HTML pre element may contain other inline elements except "img", "object", "applet", "big", "small", "sub", sup". "font", and "basefont". HTML inline elements are listed at the HTML Inline Elements.&lt;br /&gt;HTML Pre Element Inside&lt;br /&gt;&lt;br /&gt;The HTML pre element can be contained inside the elements "applet", "blockquote", "body", "button", "center", "del", "dd", "div", "fieldset", "form", "iframe", "ins", "li", "map", "noframes", "noscript", "object", "td", and "th".&lt;br /&gt;HTML Pre Element Use Example&lt;br /&gt;&lt;br /&gt;The PRE element is handy for showing program code or part of file content as in this example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;switch ( )&lt;br /&gt;{&lt;br /&gt;case condition1&lt;br /&gt; break;&lt;br /&gt;case condition2&lt;br /&gt;   break;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is how it looks:&lt;br /&gt;&lt;br /&gt;switch ( )&lt;br /&gt;{&lt;br /&gt;case condition1&lt;br /&gt; break;&lt;br /&gt;case condition2&lt;br /&gt;   break;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-4478864183598031819?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/4478864183598031819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/pre-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4478864183598031819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4478864183598031819'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/pre-tag.html' title='PRE tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-7493042365571527000</id><published>2009-03-03T21:31:00.000-08:00</published><updated>2009-03-03T21:33:46.013-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CODE tag'/><title type='text'>CODE tag</title><content type='html'>The code tag is designed to display computer code in a special font, usually in a mono spaced font style. However, the exact appearance will be browser dependent. You may still need to use various HTML tags, such as br and p, to create a presentation and appearance to suit your needs.&lt;br /&gt; &lt;br /&gt;An HTML code example cannot use the HTML delimiters &lt; and &gt;, because they will be executed by the browser as real HTML code. Rather you must substitute a &amp;lt; for the &lt; and a &amp;gt; for the &gt;.&lt;br /&gt; &lt;br /&gt;Usually, the display font appearance for the code, kbd, samp, and tt tags is the same for a specific browser.&lt;br /&gt; &lt;br /&gt;The pre tag is more commonly used to display code.&lt;br /&gt; &lt;br /&gt;The separate closing tag is mandatory.&lt;br /&gt; &lt;br /&gt;Attributes and Events&lt;br /&gt; &lt;br /&gt;class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-7493042365571527000?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/7493042365571527000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/code-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7493042365571527000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7493042365571527000'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/code-tag.html' title='CODE tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-2514362132490648000</id><published>2009-03-03T21:28:00.000-08:00</published><updated>2009-03-03T21:31:09.369-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KBD tag'/><title type='text'>KBD tag</title><content type='html'>kbd is an HTML tag that is used to specify text to be typed in by the user (usually on a keyboard). While seldom used, this tag is useful for writing documentation for computer users. While the tag usually renders text by displaying it in a monospaced font, the tag should not be used simply for this purpose.&lt;br /&gt;&lt;br /&gt;See also: code, font, plaintext, pre, samp, tt, var&lt;br /&gt;Attributes&lt;br /&gt;&lt;br /&gt;The kbd tag does not have any required HTML attributes. It does, however have numerous allowable attributes including:&lt;br /&gt;&lt;br /&gt;    * HTML Core Attributes&lt;br /&gt;          o class (type: CDATA) - space separated list of classes&lt;br /&gt;          o id (type: ID) - document-wide unique id&lt;br /&gt;          o style (type: Style Sheet) - associated style information&lt;br /&gt;          o title (type: Text) - advisory title/amplification; this information is usually displayed through tooltips&lt;br /&gt;             &lt;br /&gt;    * HTML International Attributes (I18N)&lt;br /&gt;          o dir (type: Custom) - specifies the direction of weak or neutral text; valid values include ltr (left to right) or rtl (right to left)&lt;br /&gt;          o lang (type: Custom) - specifies the Language Code of the language used in the text&lt;br /&gt;             &lt;br /&gt;    * HTML Event Attributes&lt;br /&gt;          o onclick (type: Script) - a pointer button was clicked&lt;br /&gt;          o ondblclick (type: Script) - a pointer button was double clicked&lt;br /&gt;          o onkeydown (type: Script) - a key was pressed down&lt;br /&gt;          o onkeypress (type: Script) - a key was pressed and released&lt;br /&gt;          o onkeyup (type: Script) - a key was released&lt;br /&gt;          o onmousedown (type: Script) - a pointer button was pressed down&lt;br /&gt;          o onmousemove (type: Script) - a pointer was moved within&lt;br /&gt;          o onmouseout (type: Script) - a pointer was moved away&lt;br /&gt;          o onmouseover (type: Script) - a pointer was moved onto&lt;br /&gt;          o onmouseup (type: Script) - a pointer button was released&lt;br /&gt;&lt;br /&gt;Usage&lt;br /&gt;&lt;br /&gt;To use the kbd tag, simply place opening and closing HTML tags around the characters that should be entered by the user. For example:&lt;br /&gt;&lt;br /&gt;    To destroy the usefulness of your computer, type &lt;kbd&gt;del C:\*.* /S /Q&lt;/kbd&gt; at the command prompt.&lt;br /&gt;&lt;br /&gt;On browsers that support this tag, this will typically cause the phrase "del *.* /S /Q" to be displayed in a monospaced font. Keep in mind that the purpose of this tag is to specify text to be typed in by the user, not to format your text. If you simply want to use a teletype font, you should technically use Cascading Style Sheets or the pre tag, however there are also the deprecated plaintext, samp, and tt tags that will do this as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-2514362132490648000?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/2514362132490648000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/kbd-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2514362132490648000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2514362132490648000'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/kbd-tag.html' title='KBD tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-2062574600700842274</id><published>2009-03-03T21:26:00.000-08:00</published><updated>2009-03-03T21:28:50.167-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAMP tag'/><title type='text'>SAMP tag</title><content type='html'>The samp tag is designed to place emphasis on a short string of special characters. The designated text is displayed in a teletype or mono space font face. The actual appearance will be determined by the browser.&lt;br /&gt; &lt;br /&gt;For many browsers, the display font appearance for the code, kbd, samp, and tt tags is the same.&lt;br /&gt; &lt;br /&gt;The separate closing tag is mandatory.&lt;br /&gt; &lt;br /&gt;Attributes and Events&lt;br /&gt; &lt;br /&gt;class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-2062574600700842274?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/2062574600700842274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/samp-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2062574600700842274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2062574600700842274'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/samp-tag.html' title='SAMP tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-2260002256693790365</id><published>2009-03-03T21:20:00.000-08:00</published><updated>2009-03-03T21:21:11.229-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TT tag'/><title type='text'>TT tag</title><content type='html'>The &lt;tt&gt; tag causes the designated text to be displayed in a teletype or mono space font face. The actual appearance will be determined by the browser.&lt;br /&gt; &lt;br /&gt;Usually, the display font appearance for the code, kbd, samp, and tt tags is the same. The listing tag has been deprecated.&lt;br /&gt; &lt;br /&gt;The closing tag is mandatory.&lt;br /&gt; &lt;br /&gt;Core attributes:&lt;br /&gt; &lt;br /&gt;class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-2260002256693790365?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/2260002256693790365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/tt-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2260002256693790365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2260002256693790365'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/tt-tag.html' title='TT tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-3089726707773499780</id><published>2009-03-03T02:17:00.000-08:00</published><updated>2009-03-03T02:24:23.897-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PLAINTEXT tag'/><title type='text'>PLAINTEXT tag</title><content type='html'>This is an obsolete tag that has been replaced by the PRE tag. It's behavior can be very odd on some browsers, including recent browser versions (some browsers do not recognize the closing tag, thus everything after the opening &lt;PLAINTEXT&gt; is rendered as plain text, including the closing BODY and HTML tags.&lt;br /&gt;&lt;br /&gt;Example code:&lt;br /&gt;&lt;br /&gt;An example of how the &lt;PLAINTEXT&gt;&lt;I&gt;Plaintext tag&lt;/I&gt;&lt;/PLAINTEXT&gt; works in a document. Note that HTML tags are ignored within the PLAINTEXT tags.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-3089726707773499780?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/3089726707773499780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/plaintext-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3089726707773499780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3089726707773499780'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/plaintext-tag.html' title='PLAINTEXT tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-8137431514947377502</id><published>2009-03-03T02:04:00.000-08:00</published><updated>2009-03-03T02:16:23.981-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XMP tag'/><title type='text'>XMP tag</title><content type='html'>XMP stands for "Extensible Metadata Platform", an XML/RDF-based metadata format which is being pushed by Adobe. Information in this format can be embedded in many different image file types including JPG, JP2, TIFF, GIF, EPS, PDF, PSD, DNG, PNG, DJVU, SVG and MIFF, as well as MOV, AVI, ASF, WMV, FLV, SWF and MP4 videos, and WMA and audio formats supporting ID3v2 information.&lt;br /&gt;&lt;br /&gt;The XMP Tag ID's aren't listed because in most cases they are identical to the Tag Name.&lt;br /&gt;&lt;br /&gt;All XMP information is stored as character strings. The Writable column specifies the information format: string is an unformatted string, integer is a string of digits (possibly beginning with a '+' or '-'), real is a floating point number, rational is entered as a floating point number but stored as two integer strings separated by a '/' character, date is a date/time string entered in the format "YYYY:MM:DD HH:MM:SS[.SS][+/-HH:MM]", boolean is either "True" or "False", and lang-alt is a list of string alternatives in different languages.&lt;br /&gt;&lt;br /&gt;Individual languages for lang-alt tags are accessed by suffixing the tag name with a '-', followed by an RFC 3066 language code (ie. "XMP:Title-fr", or "Rights-en-US"). A lang-alt tag with no language code accesses the "x-default" language, but causes other languages for this tag to be deleted when writing. The "x-default" language code may be specified when writing to preserve other existing languages (ie. "XMP-dc:Description-x-default"), but note that other languages are still deleted if the "x-default" language is deleted. When reading, "x-default" is not specified.&lt;br /&gt;&lt;br /&gt;The XMP tags are organized according to schema Namespace in the following tables. Note that a few of the longer namespace prefixes given below have been shortened for convenience (since the family 1 group names are derived from these by adding a leading "XMP-"). In cases where a tag name exists in more than one namespace, less common namespaces are avoided when writing. However, any namespace may be written by specifying a family 1 group name for the tag, ie) XMP-exif:Contrast or XMP-crs:Contrast.&lt;br /&gt;&lt;br /&gt;ExifTool will extract XMP information even if it is not listed in these tables. For example, the pdfx namespace doesn't have a predefined set of tag names because it is used to store application-defined PDF information, but this information is extracted by ExifTool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-8137431514947377502?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/8137431514947377502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/xmp-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8137431514947377502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8137431514947377502'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/xmp-tag.html' title='XMP tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-3225449196447539119</id><published>2009-03-03T01:59:00.000-08:00</published><updated>2009-03-03T02:03:56.169-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ADDRESS tag'/><title type='text'>ADDRESS tag</title><content type='html'>Note: If you don't know what a tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.&lt;br /&gt;&lt;br /&gt;Table of contents&lt;br /&gt;&lt;br /&gt;    * Description&lt;br /&gt;    * Attributes&lt;br /&gt;    * Events&lt;br /&gt;    * Examples&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Description&lt;br /&gt;The HTML address tag is commonly used to provide contact information at the bottom or beginning of a document or a form. It could be used, for example, to provide information about the enterprise behind the website, the author of a specific article or the author of the website itself. Note that browsers may change the aspect of the text between these tags (e.g., italic font).&lt;br /&gt;&lt;br /&gt;Attributes&lt;br /&gt;id (name)&lt;br /&gt;The "id" attribute assigns an identifier to the associated element. This identifier must be unique in the document and can be used to refer to that element.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;p id="paragraph1"&gt;This is the first paragraph named as paragraph1. To dynamically change its properties use this identifier.&lt;/p&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;class (cdata)&lt;br /&gt;The "class" attribute assigns a class name (or a list of class names separated by spaces) to the container element. It's used with style sheets and tells the browser the class to which the element is associated with. A class gives visual attributes to elements.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;p class="references"&gt;This article is based on the book "Wind in the trees" by Jhon L. Brooks&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="references important"&gt;This article is based on the book "Wind in the trees" by Jhon L. Brooks... and is more important than the one before.&lt;/p&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;style (style)&lt;br /&gt;Defines a visual style of this element. Is a better practice to define styles attributes in external style sheets grouping them in classes. Attributes in the "style" parameter must preserve this order "name : value" and be separated by a semi-colon.&lt;br /&gt;&lt;br /&gt;If you're writing XHTML code it's recommended not to use this attribute and try style sheet classes (with the "class" attribute).&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;p style="color: #0000FF; font-size: 12pt"&gt;This is a paragraph with a defined style&lt;/p&gt;&lt;br /&gt;&lt;p&gt;And this is another text without style.&lt;/p&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;title (text)&lt;br /&gt;Indicates a title for the element. Used to give a short description about the element that is usually shown as a "tool tip" when the user put the mouse pointer over the element.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code  View&lt;br /&gt;&lt;a title="HTMLQuick.com" href="http://www.htmlquick.com"&gt;HTML code&lt;/a&gt;  HTML code&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;lang (langcode)&lt;br /&gt;Specifies the language of an element's content. The default value in "unknown".&lt;br /&gt;&lt;br /&gt;When writing XHTML code the syntax "xml:lang" represents a preferred alternative in XHTML 1.0 and a replacement in XHTML 1.1 (e.g., xml:lang="en").&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;p lang="en"&gt;This is a paragraph in english.&lt;/p&gt;&lt;br /&gt;&lt;p lang="es"&gt;Este es un p&amp;aacute;rrafo en espa&amp;ntilde;ol.&lt;/p&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;dir&lt;br /&gt;Specifies the text direction of the element's contents and attribute values, as well as tables directionality. It has two possible values that are case insensitive:&lt;br /&gt;&lt;br /&gt;    * RTL: Right to left.&lt;br /&gt;    * LTR: Left to right.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;q lang="he" dir="rtl"&gt;...a Hebrew quotation...&lt;/q&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Events&lt;br /&gt;&lt;br /&gt;    * onclick&lt;br /&gt;    * ondblclick&lt;br /&gt;    * onmousedown&lt;br /&gt;    * onmouseup&lt;br /&gt;    * onmouseover&lt;br /&gt;    * onmousemove&lt;br /&gt;    * onmouseout&lt;br /&gt;    * onkeypress&lt;br /&gt;    * onkeydown&lt;br /&gt;    * onkeyup&lt;br /&gt;&lt;br /&gt;See complete list and information about events in HTML&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Events in HTML&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As well as attributes, events can be defined in HTML tags. Events, instead of giving values to the elements like the attributes, trigger actions when they occurs. These actions are defined by client-side scripts that are programs written to perform some action in a specific language (e.g., JavaScript, VBScript, etc.). There are different events that occurs in different instances according to browsers or users actions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;List of events&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Below is al list of all events available for the HTML 4.01 Standard.&lt;br /&gt;&lt;br /&gt;    * onload: The onload event occurs when the user agent finishes loading a window or all frames within a frameset.&lt;br /&gt;    * onunload: The onunload event occurs when the user agent removes a document from a window or frame.&lt;br /&gt;    * onclick: The onclick event is triggered when the mouse button is clicked over the element.&lt;br /&gt;    * ondblclick: The ondblclick event occurs when the pointing device button is double clicked over an element.&lt;br /&gt;    * onmousedown: The onmousedown event is triggered when the mouse button is pressed over the element.&lt;br /&gt;    * onmouseup: The onmouseup event occurs when the pointing device button is released over an element.&lt;br /&gt;    * onmouseover: The onmouseover event is triggered when the mouse is moved onto the element.&lt;br /&gt;    * onmousemove: The onmousemove event occurs when the pointing device is moved while it is over an element.&lt;br /&gt;    * onmouseout: The onmouseout event is triggered when the mouse is moved away from the element.&lt;br /&gt;    * onfocus: The onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation.&lt;br /&gt;    * onblur: The onblur event is triggered when an element loses focus either by the pointing device or by tabbing navigation.&lt;br /&gt;    * onkeypress: The onkeypress event occurs when a key is pressed and released over an element.&lt;br /&gt;    * onkeydown: The onkeydown event is triggered when a key is pressed down over the element.&lt;br /&gt;    * onkeyup: The onkeyup event occurs when a key is released over an element.&lt;br /&gt;    * onsubmit: The onsubmit event is triggered when a form is submitted.&lt;br /&gt;    * onreset: The onreset event occurs when a form is reset.&lt;br /&gt;    * onselect: The onselect event is triggered when a user selects some text in a text field.&lt;br /&gt;    * onchange: The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-3225449196447539119?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/3225449196447539119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/address-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3225449196447539119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3225449196447539119'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/address-tag.html' title='ADDRESS tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-8113960281379343655</id><published>2009-03-03T01:51:00.000-08:00</published><updated>2009-03-03T01:58:46.736-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BLOCKQUOTE tag'/><title type='text'>BLOCKQUOTE tag</title><content type='html'>The HTML blockquote tags are used to define the HTML blockquote element. The HTML blockquote element begins with the HTML &lt;blockquote&gt; tag and ends with the HTML &lt;/blockquote&gt; tag. The HTML blockquote element is used to format a block of text as a long quote which is indented more than the surrounding text on the left and the right.&lt;br /&gt;HTML Blockquote Element Attributes&lt;br /&gt;&lt;br /&gt;HTML "blockquote" element attributes include:&lt;br /&gt;&lt;br /&gt;    * cite="uri" - Specifies the URI of the source of the quote.&lt;br /&gt;    * class - The class attribute is used in conjunction with style sheets to associate an element with a class. The class attribute can set a class for specific element types or it can be independent of element types and work for all elements. The class attribute will provide the settings for specific style formatting. CSS properties are shown at the CSS Properties page.&lt;br /&gt;    * ID - The ID attribute is used to apply style settings to specific individual HTML elements.&lt;br /&gt;    * style - The style attribute is used to apply style settings for the specific element the style attribute is included with. An example is" &lt;p style="font: 16pt courier"&gt; - This sets the style or color of the text. This statement starts a paragraph with color, green: &lt;p style="color: green"&gt;. The STYLE attribute is common to most HTML elements (See the CSS Properties page).&lt;br /&gt;    * title - Used to give specific elements a title which may appear as a tooltip in some browsers when the mouse is held at or near the element. &lt;br /&gt;&lt;br /&gt;HTML Blockquote Element Contents&lt;br /&gt;&lt;br /&gt;The HTML blockquote element may contain other block elements such as headers, paragraphs, preformat blocks and tables. HTML block elements are listed at the HTML Block Elements. The HTML "blockquote" element may also contain the "script" element.&lt;br /&gt;HTML Blockquote Element Inside&lt;br /&gt;&lt;br /&gt;The HTML blockquote element can be contained inside the elements "applet", "blockquote", "body", "button", "center", "del", "dd", "div", "fieldset", "form", "iframe", "ins", "li", "map", "noframes", "noscript", "object", "td", and "th". The HTML "blockquote" element should not be contained inside a paragraph element.&lt;br /&gt;HTML Blockquote Element Use Example&lt;br /&gt;&lt;br /&gt;This is the HTML code:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The preamble of the Constitution says:&lt;br&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This is how it looks:&lt;br /&gt;&lt;br /&gt;The preamble of the Constitution says:&lt;br /&gt;&lt;br /&gt;    We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-8113960281379343655?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/8113960281379343655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/blockquote-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8113960281379343655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8113960281379343655'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/blockquote-tag.html' title='BLOCKQUOTE tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-1286552739604618425</id><published>2009-03-03T01:47:00.000-08:00</published><updated>2009-03-03T01:51:19.955-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CITE tag'/><title type='text'>CITE tag</title><content type='html'>The &lt;cite&gt; tag takes the selected block of text (a citation) and displays it in italics. Unlike the blockquote tag, the citation is not preceded or followed by paragraph breaks. So the citation remain inline. You may still need to use other HTML tags to effect the textual display and appearance that you desire.&lt;br /&gt; &lt;br /&gt;It is recommended that you use the blockquote tag for long citations and the cite tag for short citations.&lt;br /&gt; &lt;br /&gt;The closing tag is mandatory.&lt;br /&gt; &lt;br /&gt;Core Attributes&lt;br /&gt; &lt;br /&gt;class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-1286552739604618425?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/1286552739604618425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/cite-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1286552739604618425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1286552739604618425'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/cite-tag.html' title='CITE tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-2218651723001619728</id><published>2009-03-03T01:43:00.000-08:00</published><updated>2009-03-03T01:46:42.827-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DFN tag'/><title type='text'>DFN tag</title><content type='html'>Note: If you don't know what a tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.&lt;br /&gt;&lt;br /&gt;Table of contents&lt;br /&gt;&lt;br /&gt;    * Description&lt;br /&gt;    * Attributes&lt;br /&gt;    * Events&lt;br /&gt;    * Examples&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Description&lt;br /&gt;The HTML dfn tag indicates that this is the defining instance of the term enclosed by the tags.&lt;br /&gt;&lt;br /&gt;Attributes&lt;br /&gt;id (name)&lt;br /&gt;The "id" attribute assigns an identifier to the associated element. This identifier must be unique in the document and can be used to refer to that element.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;p id="paragraph1"&gt;This is the first paragraph named as paragraph1. To dynamically change its properties use this identifier.&lt;/p&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;class (cdata)&lt;br /&gt;The "class" attribute assigns a class name (or a list of class names separated by spaces) to the container element. It's used with style sheets and tells the browser the class to which the element is associated with. A class gives visual attributes to elements.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;p class="references"&gt;This article is based on the book "Wind in the trees" by Jhon L. Brooks&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="references important"&gt;This article is based on the book "Wind in the trees" by Jhon L. Brooks... and is more important than the one before.&lt;/p&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;style (style)&lt;br /&gt;Defines a visual style of this element. Is a better practice to define styles attributes in external style sheets grouping them in classes. Attributes in the "style" parameter must preserve this order "name : value" and be separated by a semi-colon.&lt;br /&gt;&lt;br /&gt;If you're writing XHTML code it's recommended not to use this attribute and try style sheet classes (with the "class" attribute).&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;p style="color: #0000FF; font-size: 12pt"&gt;This is a paragraph with a defined style&lt;/p&gt;&lt;br /&gt;&lt;p&gt;And this is another text without style.&lt;/p&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;title (text)&lt;br /&gt;Indicates a title for the element. Used to give a short description about the element that is usually shown as a "tool tip" when the user put the mouse pointer over the element.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code  View&lt;br /&gt;&lt;a title="HTMLQuick.com" href="http://www.htmlquick.com"&gt;HTML code&lt;/a&gt;  HTML code&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;lang (langcode)&lt;br /&gt;Specifies the language of an element's content. The default value in "unknown".&lt;br /&gt;&lt;br /&gt;When writing XHTML code the syntax "xml:lang" represents a preferred alternative in XHTML 1.0 and a replacement in XHTML 1.1 (e.g., xml:lang="en").&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;p lang="en"&gt;This is a paragraph in english.&lt;/p&gt;&lt;br /&gt;&lt;p lang="es"&gt;Este es un p&amp;aacute;rrafo en espa&amp;ntilde;ol.&lt;/p&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;dir&lt;br /&gt;Specifies the text direction of the element's contents and attribute values, as well as tables directionality. It has two possible values that are case insensitive:&lt;br /&gt;&lt;br /&gt;    * RTL: Right to left.&lt;br /&gt;    * LTR: Left to right.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Code begin &lt;q lang="he" dir="rtl"&gt;...a Hebrew quotation...&lt;/q&gt;Code end&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Events&lt;br /&gt;&lt;br /&gt;    * onclick&lt;br /&gt;    * ondblclick&lt;br /&gt;    * onmousedown&lt;br /&gt;    * onmouseup&lt;br /&gt;    * onmouseover&lt;br /&gt;    * onmousemove&lt;br /&gt;    * onmouseout&lt;br /&gt;    * onkeypress&lt;br /&gt;    * onkeydown&lt;br /&gt;    * onkeyup&lt;br /&gt;&lt;br /&gt;See complete list and information about events in HTML&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Events in HTML&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As well as attributes, events can be defined in HTML tags. Events, instead of giving values to the elements like the attributes, trigger actions when they occurs. These actions are defined by client-side scripts that are programs written to perform some action in a specific language (e.g., JavaScript, VBScript, etc.). There are different events that occurs in different instances according to browsers or users actions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;List of events&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Below is al list of all events available for the HTML 4.01 Standard.&lt;br /&gt;&lt;br /&gt;    * onload: The onload event occurs when the user agent finishes loading a window or all frames within a frameset.&lt;br /&gt;    * onunload: The onunload event occurs when the user agent removes a document from a window or frame.&lt;br /&gt;    * onclick: The onclick event is triggered when the mouse button is clicked over the element.&lt;br /&gt;    * ondblclick: The ondblclick event occurs when the pointing device button is double clicked over an element.&lt;br /&gt;    * onmousedown: The onmousedown event is triggered when the mouse button is pressed over the element.&lt;br /&gt;    * onmouseup: The onmouseup event occurs when the pointing device button is released over an element.&lt;br /&gt;    * onmouseover: The onmouseover event is triggered when the mouse is moved onto the element.&lt;br /&gt;    * onmousemove: The onmousemove event occurs when the pointing device is moved while it is over an element.&lt;br /&gt;    * onmouseout: The onmouseout event is triggered when the mouse is moved away from the element.&lt;br /&gt;    * onfocus: The onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation.&lt;br /&gt;    * onblur: The onblur event is triggered when an element loses focus either by the pointing device or by tabbing navigation.&lt;br /&gt;    * onkeypress: The onkeypress event occurs when a key is pressed and released over an element.&lt;br /&gt;    * onkeydown: The onkeydown event is triggered when a key is pressed down over the element.&lt;br /&gt;    * onkeyup: The onkeyup event occurs when a key is released over an element.&lt;br /&gt;    * onsubmit: The onsubmit event is triggered when a form is submitted.&lt;br /&gt;    * onreset: The onreset event occurs when a form is reset.&lt;br /&gt;    * onselect: The onselect event is triggered when a user selects some text in a text field.&lt;br /&gt;    * onchange: The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-2218651723001619728?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/2218651723001619728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/dfn-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2218651723001619728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2218651723001619728'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/03/dfn-tag.html' title='DFN tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-4871513813234308645</id><published>2009-02-28T21:21:00.000-08:00</published><updated>2009-02-28T21:24:16.401-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IMAGE tag'/><title type='text'>IMAGE tag</title><content type='html'>The &lt;img&gt; tag embeds an image in an HTML page.&lt;br /&gt;&lt;br /&gt;The &lt;img&gt; tag has two required attributes: src and alt.&lt;br /&gt;The Image Tag and the Src Attribute&lt;br /&gt;&lt;br /&gt;In HTML, images are defined with the &lt;img&gt; tag. &lt;br /&gt;&lt;br /&gt;The &lt;img&gt; tag is empty, which means that it contains attributes only and it has no closing tag.&lt;br /&gt;&lt;br /&gt;To display an image on a page, you need to use the src attribute. Src stands for "source". The value of the src attribute is the URL of the image you want to display on your page.&lt;br /&gt;&lt;br /&gt;The syntax of defining an image:&lt;br /&gt;&lt;br /&gt;&lt;img src="url"&gt;&lt;br /&gt;&lt;br /&gt;The URL points to the location where the image is stored. An image named "boat.gif" located in the directory "images" on "www.w3schools.com" has the URL: http://www.w3schools.com/images/boat.gif.&lt;br /&gt;&lt;br /&gt;The browser puts the image where the image tag occurs in the document. If you put an image tag between two paragraphs, the browser shows the first paragraph, then the image, and then the second paragraph.&lt;br /&gt;The Alt Attribute&lt;br /&gt;&lt;br /&gt;The alt attribute is used to define an "alternate text" for an image. The value of the alt attribute is an author-defined text:&lt;br /&gt;&lt;br /&gt;&lt;img src="boat.gif" alt="Big Boat"&gt;&lt;br /&gt;&lt;br /&gt;The "alt" attribute tells the reader what he or she is missing on a page if the browser can't load images. The browser will then display the alternate text instead of the image. It is a good practice to include the "alt" attribute for each image on a page, to improve the display and usefulness of your document for people who have text-only browsers.&lt;br /&gt;Basic Notes - Useful Tips&lt;br /&gt;&lt;br /&gt;If an HTML file contains ten images - eleven files are required to display the page right. Loading images take time, so my best advice is: Use images carefully.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-4871513813234308645?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/4871513813234308645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/image-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4871513813234308645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4871513813234308645'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/image-tag.html' title='IMAGE tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-6490284117540319718</id><published>2009-02-28T21:09:00.000-08:00</published><updated>2009-02-28T21:20:56.293-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ANCHOR tag'/><title type='text'>ANCHOR tag</title><content type='html'>Links on web pages are created using the anchor  tags. These links can point to a different document&lt;br /&gt;on the Internet or to some anchor on the same page. Documents linked in this manner need not be HTML (or PHP/ASP) files. You can place a link to any kind of file.&lt;br /&gt;&lt;br /&gt;Anchor Tag attributes&lt;br /&gt;    charset=  text&lt;br /&gt;    Character encoding which specifies the character encoding of the target URL.&lt;br /&gt;    Example: charset=utf-8&lt;br /&gt;    href =  relative address (i.e. the address of a file RELATIVE to the current document)&lt;br /&gt;    move up to next higher folder using ../&lt;br /&gt;    move down to a lower folder using folder (or 'directory' on the server) name&lt;br /&gt;    display from fragmentation-id position on document using #fragmentation-id.&lt;br /&gt;    Example-1:  - current document displayed with fragmentation-id section at top of display. This is coding for moving round the same document, perhaps with an index at the top linking to sub-sections lower down.&lt;br /&gt;    Example-2:  - file in current folder displayed with top of page at top of display. With no fragmentation id specified, the display is from the top of the page.&lt;br /&gt;    Example-3:  - file in next highest folder is displayed with the top of the page at the top of the display.&lt;br /&gt;    Example-4:  - a file in a lower folder is displayed with fragmentation-id at the top of the display.&lt;br /&gt;    href =  absolute address&lt;br /&gt;    Example-5:  - the server default file in directory at this absolute address is displayed from top of page.&lt;br /&gt;    Example-6:  - specified file at this absolute address is displayed from top of page.&lt;br /&gt;    Example-7:  - file with this absolute address is displayed from fragmentation-id position.&lt;br /&gt;    Example-8:  - file (schedule.htm) with absolute address (http://www.bbc.com/radio4/) - is displayed from fragmentation-id position (#today) , and gives a fragmentation-id (refbbc) for the current position in the current document.&lt;br /&gt;&lt;br /&gt;    types of file&lt;br /&gt;        Normally the link is to another webpage (with file extension htm or html), but links to other file extensions are possible. An extensive variety of files can be accommodated, but the presumption is that the user has associated the file extension with a suitable application program, for example:&lt;br /&gt;        .doc associated with MS Word.     .pdf associated with Adobe Reader.     .ppt associated with MS Powerpoint.&lt;br /&gt;        Formats may include .wav for audio, .pdf / .doc for desktop publishing, .ppt for presentation, .exl for spreadsheet, etc. Consequently, only the most popular, legacy formats should be linked, in order to ensure that the majority of users' set-ups can deal with the format presented.&lt;br /&gt;        Note 1: A file-type icon is often added to the link for visual confirmation of a non-HTML link -&lt;br /&gt;        word minutes.doc  estimates.exl excel&lt;br /&gt;        adobe acrobat instructions.pdf  presentation.ppt adobe acrobat&lt;br /&gt;        Note 2: A link to a PDF format document is often accompanied by&lt;br /&gt;        adobe reader Link to Adobe Reader download&lt;br /&gt;        providing the user with a link to downloadable software, which can be used to view the file.&lt;br /&gt;&lt;br /&gt;    href =  mailto (i.e. to send an e-mail)&lt;br /&gt;    Example: &lt;a href="mailto:e-mail"&gt;e-mail&lt;/a&gt;&lt;br /&gt;    Note 1: Minimise spam, frustrate the spambots by using coding to hide the e-mail address.&lt;br /&gt;    Note 2 : Make it clear that it is an e-mail link.&lt;br /&gt;    name=  text&lt;br /&gt;    Example:  - signifies a Fragmentation Identifier (anchor) position on the current document.&lt;br /&gt;    Note: a linking href must use a leading # after the document name (see Examples - 1,4,7,8)&lt;br /&gt;      further Fragmentation Identifier&lt;br /&gt;    The id attribute in the start tag of A (and other elements) identifies a reference position in the document. Name (or id) must be unique for the document. When linked using the fragmentation identifier, the browser shows the start of the fragment at the top of the display.&lt;br /&gt;      id=text&lt;br /&gt;    Example: &lt;p id="sports"&gt; - signifies a fragmentation identifier position on the page.&lt;br /&gt;    Note: the linking href must use a leading # after the document name (see Examples - 1,4,7,8)&lt;br /&gt;    rel=  text&lt;br /&gt;    Specifies the relationship between the current document and the target URL.&lt;br /&gt;    Example: rel=index&lt;br /&gt;    Options: alternate,designates,stylesheet,start,next,prev,contents,index,glossary,copyright, chapter,section,subsection,appendix,help,bookmark&lt;br /&gt;    rev=  text&lt;br /&gt;    Specifies the reverse relationship between the document and the target URL&lt;br /&gt;    Example: rel=subsection&lt;br /&gt;    Options: alternate,designates,stylesheet,start,next,prev,contents,index,glossary, copyright,chapter,section,subsection,appendix,help,bookmark&lt;br /&gt;    target=  text&lt;br /&gt;    Example: target="_blank" - retains 'stickability' and hence generally preferable.&lt;br /&gt;    Options:    a href="URL" target="_blank"  creates a new window of default size&lt;br /&gt;    a href="URL"  target="_parent"  targets the frameset in which the current page belongs&lt;br /&gt;    a href="URL"  target="_self" targets the current window&lt;br /&gt;    a href="URL"  target="_top" targets the main browser window, eliminating all frames&lt;br /&gt;    title=  text&lt;br /&gt;    The text displayed when the mouse hovers over the text-link (mouse-over tool-tip).&lt;br /&gt;    Note: In the case of a graphic link (depending on the browser), the ALT attribute of the IMG tag may take precedence.&lt;br /&gt;    Example: title="Tool Tip displayed on hover" - when the mouse hovers over the link, a tool tip is displayed.&lt;br /&gt;&lt;br /&gt;    Mouseover Tool Tip&lt;br /&gt;&lt;br /&gt;            * an exciting description can encourage the user to investigate the link&lt;br /&gt;            * use to give extra information&lt;br /&gt;&lt;br /&gt;Anchor Tag hypertext link&lt;br /&gt;    hypertext as  text&lt;br /&gt;    Example: &lt;a href="tag_a.htm"&gt; Anchor tag definition&lt;/a&gt; - SEs use linking text as keywords to categorise the content of the link. Decide which are the most appropriate keywords for the content and use them in the link text.&lt;br /&gt;&lt;br /&gt;    Link-text content&lt;br /&gt;&lt;br /&gt;            * One way to improve your Search Engine ranking.&lt;br /&gt;            * Carefully select appropriate, hypertext keywords within the website.&lt;br /&gt;            * Ask external link creators to use your own, selected, keyword-rich anchor-text in their external hypertext link.&lt;br /&gt;&lt;br /&gt;    Link-text appearance&lt;br /&gt;&lt;br /&gt;            * length can be controlled by incorporating the line return character&lt;br /&gt;            * change font characteristics using CSS (see below)&lt;br /&gt;&lt;br /&gt;    hypertext as  graphic&lt;br /&gt;       Note 1: Always specify IMG attributes width, height, alt, border.&lt;br /&gt;    Note 2: According to the browser, with the Tool Tip the IMG, alt attribute may take priority over the A, title attribute.&lt;br /&gt;    Homepage  Example: &lt;a href="index.htm" title="home"&gt;&lt;img src="home.gif" alt="Homepage" width=16 height=16&gt;&lt;/a&gt;&lt;br /&gt;    - image is bordered by the link colour if border=0 is omitted.&lt;br /&gt;    Homepage  Example: &lt;a href="index.htm" title="home"&gt;&lt;img src="home.gif" alt="Homepage" width=16 height=16 border=0&gt;&lt;/a&gt;&lt;br /&gt;    - use border=0 to eliminate link-colour border to graphic.&lt;br /&gt;    Homepage&lt;br /&gt;    Home&lt;br /&gt;     Example: &lt;a href="index.htm" title="home"&gt;&lt;img src="home.gif" alt="Homepage" width=16 height=16 border=0&gt;&lt;br&gt;Home&lt;/a&gt;&lt;br /&gt;    - a combination of graphic and text is often used to clearly identify the hyperlink.&lt;br /&gt;     &lt;br /&gt;&lt;br /&gt;    Client-side mapping&lt;br /&gt;        By moving the cursor to different parts of the graphic, different links can be created.&lt;br /&gt;        See the IMG tag attribute usemap for further information.&lt;br /&gt;&lt;br /&gt;Web link legacy and consistency&lt;br /&gt;    In the early days of the WWW, links were all coloured blue and underlined. Users still expect text of this colour to operate as a link, so to meet their expectations and to give them confidence when using the site, it is recommended that link text throughout the site is generally coloured blue.&lt;br /&gt;    Such a global feature should be coded in a Linked CSS stylesheet.&lt;br /&gt;&lt;br /&gt;    Dynamic link - styled attributes&lt;br /&gt;        To attract the user's attention, and to confirm that a hyperlink exists, it is always good policy to make the hypertext dynamic.&lt;br /&gt;        These sort of changes are particularly powerful for the navigation components, which could involve contrasts of the 'a hover' and 'a' css properties and values. However dynamic changes which could drastically affect nearby text and alter the layout (e.g. font-size) are not recommended.&lt;br /&gt;        Example:&lt;br /&gt;        Homepage&lt;br /&gt;        Home  The style attributes for the link text and graphic can be selected so that a mouseover produces a dynamic change of appearance.&lt;br /&gt;        This graphic has a transparent background, with the 'white' background-color showing through.&lt;br /&gt;        On 'hover' the background-color changes from 'white' to 'purple' with the link-text font-color changing from 'blue' to 'orange'.&lt;br /&gt;        Note: IE produces the expected result, Firefox makes transparent only the lower half of the graphic.&lt;br /&gt;    Linked CSS style sheet Pseudo-class selectors&lt;br /&gt;        Currently these are: hover, active, link, visited, lang, focus&lt;br /&gt;        The first four are directly relevant to an anchor tag link.&lt;br /&gt;        A linked style sheet contains declarations of global properties and values.&lt;br /&gt;        Example:&lt;br /&gt;        a:link {color:#0000CC; text-decoration:none; font-weight: bold; }&lt;br /&gt;        a:active {color:#FF0000; text-decoration:none; }&lt;br /&gt;        a:visited {color:#660099; text-decoration:none; font-weight: bold; }&lt;br /&gt;        a:hover {color:#FF9900; text-decoration:none; background-color: white; }&lt;br /&gt;        Note: use of the COLON rather than the usual full stop.&lt;br /&gt;&lt;br /&gt;        Varied CSS link tags&lt;br /&gt;            In general, it is very confusing for the user if the link tags vary throughout the website, but in exceptional cases this may be required.&lt;br /&gt;            On a linked style sheet an alternative set of parameters could be defined for the anchor attributes.&lt;br /&gt;            Example:&lt;br /&gt;            a.exc:link {color:#0000CC; text-decoration:none; font-weight: bold; }&lt;br /&gt;            a.exc:active {color:#FF0000; text-decoration:none; }&lt;br /&gt;            a.exc:visited {color:#660099; text-decoration:none; font-weight: bold; }&lt;br /&gt;            a.exc:hover {color:#FF9900; text-decoration:none; background-color: purple; }&lt;br /&gt;            Notes:&lt;br /&gt;&lt;br /&gt;                * See above example in 'Dynamic link - styled attributes'. On 'hover' the background-color is 'purple' rather than the usual 'white', making 'hover' dynamic - on a white, transparent-background, graphical link.&lt;br /&gt;                * Coded using the class="exc" notation.&lt;br /&gt;                  e.g. &lt;a class="exc" href="home.htm"&gt;&lt;img code&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Use CSS to change link characteristics&lt;br /&gt;    On rare occasions, it may be necessary to change locally, the global characteristics inherited from the linked stylesheet.&lt;br /&gt;&lt;br /&gt;    Change the static anchor-text attributes&lt;br /&gt;        The anchor-text can be changed within the anchor coding using CSS attributes.&lt;br /&gt;        This could involve:&lt;br /&gt;        color style="color:red;" font color&lt;br /&gt;        font-family  style="font-family: times new roman;" font-family&lt;br /&gt;        font-weight style="font-weight: bold;" bold&lt;br /&gt;        font-style style="font-style: italic;" italic&lt;br /&gt;        font-size style="font-size: x-small;" x-small&lt;br /&gt;        text-decoration  style="text-decoration: underline;" underline&lt;br /&gt;        background-color  style="background-color: #ffccff;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-6490284117540319718?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/6490284117540319718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/anchor-tag.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/6490284117540319718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/6490284117540319718'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/anchor-tag.html' title='ANCHOR tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-2715070469240281219</id><published>2009-02-28T20:58:00.000-08:00</published><updated>2009-02-28T21:09:19.608-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MAP tag'/><title type='text'>MAP tag</title><content type='html'>The maptag is used to define a client-side image-map. An image-map is an image with clickable areas.&lt;br /&gt;&lt;br /&gt;The name attribute is required in the map element. This attribute is associated with the &lt;img&gt;'s usemap attribute and creates a relationship between the image and the map.&lt;br /&gt;&lt;br /&gt;The map element contains a number of area elements, that defines the clickable areas in the image map.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Required Attributes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.&lt;br /&gt;Attribute  Value  Description  DTD&lt;br /&gt;name  mapname  Specifies the name for an image-map  STF&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Standard Attributes&lt;/span&gt;&lt;br /&gt;id, class, title, style, dir, lang, xml:lang, tabindex, accesskey&lt;br /&gt;&lt;br /&gt;For a full description, go to Standard Attributes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Event Attributes&lt;/span&gt;&lt;br /&gt;onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup, onfocus, onblur&lt;br /&gt;&lt;br /&gt;For a full description, go to Event Attributes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-2715070469240281219?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/2715070469240281219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/map-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2715070469240281219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2715070469240281219'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/map-tag.html' title='MAP tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-6996282002692206499</id><published>2009-02-28T20:51:00.000-08:00</published><updated>2009-02-28T20:57:36.459-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AREA TAG'/><title type='text'>AREA TAG</title><content type='html'>Das &lt;area&gt;-Tag wird zusammen mit dem map-Tag benutzt, um eine clientseitige Image Map zu erzeugen, die in verschiedene maus-sensitive Bereiche (auch »Hot Spots« genannt) unterteilt ist. Wenn die Maus einen Bereich der Map anklickt, kann ein Attribut im &lt;area&gt;-Tag direkt eine Aktion einleiten – z.B. kann in jedem Bereich ein Link durch ein href-Attribut erzeugt werden. Da der Bereich maus-sensitiv ist, kann auch das Hovern mit der Maus als Ereignis erkannt werden.&lt;br /&gt;&lt;br /&gt;Das &lt;area&gt;-Tag muss im MAP-Element enthalten sein. Das IMG-Element kann vor oder nach dem map-Tag, in dem die &lt;area&gt;-Tags enthalten sind, stehen.&lt;br /&gt;&lt;br /&gt;Für das &lt;area&gt;-Tag können keine CSS-Eigenschaften notiert werden – AREA-Elemente sind nur maus-sensitive Bereiche, aber bilden keine Blöcke im Dokument.&lt;br /&gt;&lt;br /&gt;Attribute für area&lt;br /&gt;&lt;br /&gt;accesskey&lt;br /&gt;    bestimmt eine Taste auf der Tastatur, die beim Drücken zusammen mit der Alt-, Strg- oder Befehlstaste einen Link aktiviert. &lt;br /&gt;alt&lt;br /&gt;    verknüpft einen Text mit einem individuellen Bereich der Map. Wenn die Maus über den Bereich fährt, stellt ein kleines Fenster diesen Text dar. &lt;br /&gt;coords&lt;br /&gt;    legt die (x,y)-Koordinaten für jede Form in der Image Map fest. Die Koordinaten sind der x- und y-Abstand von der oberen linken Ecke (0,0) zum Bild. Die Anzahl der Koordinaten hängt von der Form ab, die im shape-Attribut definiert wird.&lt;br /&gt;    rect: top left bottom right&lt;br /&gt;    circle: center radius, wobei center als x,y-Paar angegeben wird&lt;br /&gt;    poly: Ecken des Polygons. &lt;br /&gt;href&lt;br /&gt;    URL-Adresse eines Links. Jedes &lt;area&gt;-Tag im Bild kann einen Link enthalten. &lt;br /&gt;nohref&lt;br /&gt;    gibt an, dass der im &lt;area&gt;-Tag definierte Bereich kein Link ist. Dann zeigen die Browser den Hot Spot der Image Map beim Hovern mit der Maus auch nicht mit einem entsprechenden Cursor und der Cursor kann auch nicht durch ein Stylesheet geändert werden. &lt;br /&gt;shape&lt;br /&gt;    definiert die geometrische From der Image Map. Das kann entweder ein Kreis (circle oder circ), ein Polygon (polygon oder poly) oder ein Viereck (rectangle oder rect) sein. &lt;br /&gt;tabindex&lt;br /&gt;    ganze Zahl, die den Rang innerhalb der Tabulatoraufrufe bei der Navigation mit der Tastatur festlegt.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-6996282002692206499?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/6996282002692206499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/area-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/6996282002692206499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/6996282002692206499'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/area-tag.html' title='AREA TAG'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-7705800602674604487</id><published>2009-02-28T20:41:00.000-08:00</published><updated>2009-02-28T20:49:59.305-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TABLE TAG'/><title type='text'>TABLE TAG</title><content type='html'>Tables are defined with the table  tag. A table is divided into rows (with the &lt;tr&gt; tag), and each row is divided into data cells (with the &lt;td&gt; tag). The letters td stands for "table data," which is the content of a data cell. A data cell can contain text, images, lists, paragraphs, forms, horizontal rules, tables, etc.&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;row 1, cell 1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;row 1, cell 2&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;row 2, cell 1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;row 2, cell 2&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;How it looks in a browser:&lt;br /&gt;row 1, cell 1  row 1, cell 2&lt;br /&gt;row 2, cell 1  row 2, cell 2&lt;br /&gt;&lt;br /&gt;Tables and the Border Attribute&lt;br /&gt;&lt;br /&gt;If you do not specify a border attribute the table will be displayed without any borders. Sometimes this can be useful, but most of the time, you want the borders to show.&lt;br /&gt;&lt;br /&gt;To display a table with borders, you will have to use the border attribute:&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;Row 1, cell 1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Row 1, cell 2&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Headings in a Table&lt;br /&gt;&lt;br /&gt;Headings in a table are defined with the &lt;th&gt; tag.&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;th&gt;Heading&lt;/th&gt;&lt;br /&gt;&lt;th&gt;Another Heading&lt;/th&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;row 1, cell 1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;row 1, cell 2&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;row 2, cell 1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;row 2, cell 2&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;How it looks in a browser:&lt;br /&gt;Heading  Another Heading&lt;br /&gt;row 1, cell 1  row 1, cell 2&lt;br /&gt;row 2, cell 1  row 2, cell 2&lt;br /&gt;&lt;br /&gt;Empty Cells in a Table&lt;br /&gt;&lt;br /&gt;Table cells with no content are not displayed very well in most browsers.&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;row 1, cell 1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;row 1, cell 2&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;row 2, cell 1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;How it looks in a browser:&lt;br /&gt;row 1, cell 1  row 1, cell 2&lt;br /&gt;row 2, cell 1  &lt;br /&gt;&lt;br /&gt;Note that the borders around the empty table cell are missing (NB! Mozilla Firefox displays the border).&lt;br /&gt;&lt;br /&gt;To avoid this, add a non-breaking space (&amp;nbsp;) to empty data cells, to make the borders visible: &lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;row 1, cell 1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;row 1, cell 2&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;row 2, cell 1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;How it looks in a browser:&lt;br /&gt;row 1, cell 1  row 1, cell 2&lt;br /&gt;row 2, cell 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-7705800602674604487?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/7705800602674604487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/table-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7705800602674604487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7705800602674604487'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/table-tag.html' title='TABLE TAG'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-3569386140669624813</id><published>2009-02-19T21:07:00.000-08:00</published><updated>2009-02-19T21:12:20.685-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TR tag'/><title type='text'>TR tag</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Description&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Defines a row in a table.  It is used within the TABLE tag.  The TD tag is used within it to define a cell.&lt;br /&gt;Attributes&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;ALIGN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Aligns the text for the cells in the row - set to either 'left', 'center', 'justify' or 'right'.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;BACKGROUND&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sets the background picture for the cells in the row.  To show to an image on the same site use the local path e.g. src="button.gif" or src="folder/photo1.jpg".  You can also use dots to link to an image in the parent folder e.g. src="..\diagram.png".  &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;BGCOLOR&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Specifies the background colour of the cells in the row.  If the BACKGROUND attribute is also used, the image will cover the background colour unless the background image contains transparent areas.&lt;br /&gt;&lt;br /&gt;Colours can be defined in this format: #RRGGBB where the values are in hexadecimal format.  E.g. #FF0000 is red.  Colours can also be defined with words e.g. red.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;VALIGN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Vertically aligns the text for the cells in the row - set to either 'baseline', 'bottom', 'middle' or 'top'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-3569386140669624813?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/3569386140669624813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/tr-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3569386140669624813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3569386140669624813'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/tr-tag.html' title='TR tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-6117923316830863545</id><published>2009-02-19T21:03:00.000-08:00</published><updated>2009-02-19T21:06:58.124-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TH tag'/><title type='text'>TH tag</title><content type='html'>The &lt;th&gt; tag is used to create a header cell for the cells in a row in a table element. The purpose of the header is to provide a caption, name, or information about the column of cells. The header text will be displayed in a bold font style.&lt;br /&gt; &lt;br /&gt;The td tag is used to create cells that contain the data, information, or text that you wish to display in the table.&lt;br /&gt; &lt;br /&gt;The closing tag is optional. However, it is recommended that it always be included.&lt;br /&gt; &lt;br /&gt;The coding sequence is:&lt;br /&gt;&lt;tr&gt;&lt;th&gt; place header here &lt;/th&gt;&lt;/tr&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Core attributes:&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Attributes&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;abbr&lt;/span&gt;&lt;br /&gt;The abbr attribute is not recognized by most browsers. You use it to provide an abbreviated summary of the header text.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;align&lt;/span&gt;&lt;br /&gt;The align attribute is used to set the horizontal alignment of the cell contents. The possible values are center, char, justify, left, and right.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;axis&lt;/span&gt;&lt;br /&gt;The axis attribute is not recognized by most browsers. This attribute is used to create a list of category names which form the basis of a query. This query is executed against the cells that form the table.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;bgcolor&lt;/span&gt;&lt;br /&gt;The bgcolor attribute is deprecated effective with version 4.0. You are now to use style sheets. This attribute is used to set the background color for the cell. It can be either a named color (such as red) or a six character hexadecimal RGB color code (such as #e26fa9). This value overrides any color value that was set in the table or tr tags.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;char&lt;/span&gt;&lt;br /&gt;The char attribute permits you to select a character that will be used to align the contents of the cell. This was designed to allow the decimal points in a column of numbers to be in vertical alignment. The default value is country dependent. In the U.S., it is the first occurrence of a period or a decimal point.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;charoff&lt;/span&gt;&lt;br /&gt;The charoff attribute is an integer used to specify if the value designated in the char attribute is to be the first, second, or whatever occurrence.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;colspan&lt;/span&gt;&lt;br /&gt;The colspan attribute allows a header to span horizontally two or more columns (cells). This may be combined with the rowspan attribute to form data cells that encompass several rows and columns.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;headers&lt;/span&gt;&lt;br /&gt;The headers attribute is not recognized by most browsers. The value of this attribute is a list of cell header names. The names are the values of the cells' id attributes. This attribute is used with speech capable browsers.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;height&lt;/span&gt;&lt;br /&gt;The height attribute is deprecated effective with version 4.0. You are now to use style sheets. You use this attribute to set a minimum height for the cell. This value is an integer number of pixels. However, you may exceed this minimum height to accommodate the cell contents. The tallest cell in the row determines the actual maximum height which will be adopted by all of the cells in that row.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;nowrap&lt;/span&gt;&lt;br /&gt;The nowrap attribute is deprecated effective with version 4.0. You are now to use style sheets. You use this attribute to stop word wrapping and display the cell contents in one continuous line. However, you can insert br and p tags to create line and paragraph breaks.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;rowspan&lt;/span&gt;&lt;br /&gt;The rowspan attribute allows a cell to extend down two or more rows. This may be combined with the colspan attribute to form data cells that encompass several rows and columns.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;scope&lt;/span&gt;&lt;br /&gt;The scope attribute is not recognized by most browsers. It is used to assign a set of data cells to one header cell. The four possible values are col, colgroup, row, and rowgroup.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;valign&lt;/span&gt;&lt;br /&gt;The valign attribute is used to set the vertical alignment of the cell contents. The possible values are baseline, bottom, middle, and top.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;width&lt;/span&gt;&lt;br /&gt;The width attribute is deprecated effective with version 4.0. You are now to use style sheets. It is used to set the horizontal width of the cell. This value is an integer number of pixels. The widest cell sets the width for the entire column.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-6117923316830863545?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/6117923316830863545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/th-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/6117923316830863545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/6117923316830863545'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/th-tag.html' title='TH tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-497387954939838603</id><published>2009-02-19T20:59:00.000-08:00</published><updated>2009-02-19T21:03:09.260-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TD tag'/><title type='text'>TD tag</title><content type='html'>The &lt;td&gt; tag is used to create cells that contain the data, information, or text that you wish to display in the table. You may place as many data cells in a row as you desire.&lt;br /&gt; &lt;br /&gt;The th tag is used to create a header cell for the cells in a row in a table element.&lt;br /&gt; &lt;br /&gt;The ending tag is optional. However, it is recommended that it be included.&lt;br /&gt; &lt;br /&gt;The coding sequence is:&lt;br /&gt;&lt;tr&gt;&lt;td&gt; place data here &lt;/td&gt;&lt;/tr&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Core Attributes&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Attributes&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;abbr&lt;/span&gt;&lt;br /&gt;The abbr attribute is not recognized by most browsers. You use it to provide an abbreviated summary of the data cell text.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;align&lt;/span&gt;&lt;br /&gt;The align attribute is used to set the horizontal alignment of the cell contents. The possible values are center, char, justify, left, and right.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;axis&lt;/span&gt;&lt;br /&gt;The axis attribute is not recognized by most browsers. This attribute is used to create a list of category names which form the basis of a query. This query is executed against the cells that form the table.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;bgcolor&lt;/span&gt;&lt;br /&gt;The bgcolor attribute is deprecated effective with version 4.0. You are now to use style sheets. This attribute is used to set the background color for the cell. It can be either a named color (such as red) or a six character hexadecimal RGB color code (such as #e26fa9). This value overrides any color value that was set in the table or tr tags.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;char&lt;/span&gt;&lt;br /&gt;The char attribute permits you to select a character that will be used to align the contents of the cell. This was designed to allow the decimal points in a column of numbers to be in vertical alignment. The default value is country dependent. In the U.S., it is the first occurrence of a period or a decimal point.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;charoff&lt;/span&gt;&lt;br /&gt;The charoff attribute is an integer used to specify if the value designated in the char attribute is to be the first, second, or whatever occurrence.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;colspan&lt;/span&gt;&lt;br /&gt;The colspan attribute allows a header to span horizontally two or more columns (cells). This may be combined with the rowspan attribute to form data cells that encompass several rows and columns.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;headers&lt;/span&gt;&lt;br /&gt;The headers attribute is not recognized by most browsers. The value of this attribute is a list of cell names. The names are the values of the cells' id attributes. This attribute is used with speech capable browsers.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;height&lt;/span&gt;&lt;br /&gt;The height attribute is deprecated effective with version 4.0. You are now to use style sheets. You use this attribute to set a minimum height for the cell. This value is an integer number of pixels. However, you may exceed this minimum height to accommodate the cell contents. The tallest cell in the row determines the actual maximum height which will be adopted by all of the cells in that row.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;nowrap&lt;/span&gt;&lt;br /&gt;The nowrap attribute is deprecated effective with version 4.0. You are now to use style sheets. You use this attribute to stop word wrapping and display the cell contents in one continuous line. However, you can insert br and p tags to create line and paragraph breaks.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;rowspan&lt;/span&gt;&lt;br /&gt;The rowspan attribute allows a cell to extend down two or more rows. This may be combined with the colspan attribute to form data cells that encompass several rows and columns.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;scope&lt;/span&gt;&lt;br /&gt;The scope attribute is not recognized by most browsers. It is used to assign a set of data cells to one header cell. The four possible values are col, colgroup, row, and rowgroup.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;valign&lt;/span&gt;&lt;br /&gt;The valign attribute is used to set the vertical alignment of the cell contents. The possible values are baseline, bottom, middle, and top.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;width&lt;/span&gt;&lt;br /&gt;The width attribute is deprecated effective with version 4.0. You are now to use style sheets. It is used to set the horizontal width of the cell. This value is an integer number of pixels. The widest cell sets the width for the entire column.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-497387954939838603?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/497387954939838603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/td-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/497387954939838603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/497387954939838603'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/td-tag.html' title='TD tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-957976659243726941</id><published>2009-02-19T20:58:00.001-08:00</published><updated>2009-02-19T20:58:48.222-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Forms'/><title type='text'>Forms</title><content type='html'>Forms are the most popular way to make web pages interactive. Like forms on paper, a form on a web page allows the user to enter requested information and submit it for processing. (Fortunately, forms on a web page are processed much faster.)&lt;br /&gt;&lt;br /&gt;The following pages provide a beginning tutorial in how to put forms on your web page, how to include scripts, and some other common forms concepts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-957976659243726941?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/957976659243726941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/forms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/957976659243726941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/957976659243726941'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/forms.html' title='Forms'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-7939912188196948671</id><published>2009-02-19T20:55:00.000-08:00</published><updated>2009-02-19T20:57:58.663-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FORM tag'/><title type='text'>FORM tag</title><content type='html'>Available in versions: 2.0, 3.2, 4.0&lt;br /&gt;Browser compatibility: Explorer 4, 5  Netscape 4, 6&lt;br /&gt; &lt;br /&gt;The form tag is used to delimit the start and stop of a form element and serves as a container for form controls (fields). Control is a technical term which refers to the various elements that can be used inside a form to gather information. The information gathered is referred to as the contents or parameters of the form and is a collection of name/value pairs.&lt;br /&gt; &lt;br /&gt;The four tags that can be used to build a form are:&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;button,     input,     select,     textarea,&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;The general concept is that the user fills out the appropriate sections of the form as a response to a request for information (such as a shipping address). The user then clicks the submit button. The contents of the form are then submitted for processing, usually to another page on the web site. However, you can also submit to the same page, or to a window or frame.&lt;br /&gt; &lt;br /&gt;This ability to use a web site to display products and information, to gather a response via a form from a user, to store and manipulate the gathered information, and then to have the web site respond dynamically to the user input, is the heart of the e-commerce/e-business industry.&lt;br /&gt; &lt;br /&gt;There are two required attributes for the form tag. The action attribute dictates where the form contents will be submitted. The method attribute specifies how to send the submission.&lt;br /&gt; &lt;br /&gt;It is recommended that you should only place one form per page. It may prove best to divide a long form between two or more pages.&lt;br /&gt; &lt;br /&gt;A form element should not contain other form tags. The closing tag is mandatory.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Core Attributes&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Attributes&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;accept&lt;/span&gt;&lt;br /&gt;The accept attribute is a comma-separated list of file types that can be accepted by the server when using the type="file" content.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;accept-charset&lt;/span&gt;&lt;br /&gt;The accept-charset attribute is a comma-separated or space-separated list of the character types that the server must be able to support (process) when the contents of a form are submitted.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;action&lt;/span&gt;&lt;br /&gt;The action attribute sets the URL of the page that the contents (name/value pairs) of the form will be submitted to for processing.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;enctype&lt;/span&gt;&lt;br /&gt;The enctype attribute specifies the MIME type used to encode the contents of a form. The default is application/x-www-form-urlencoded. When using type="file" content, this attribute must be set to multipart/form-data.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt; &lt;br /&gt;method&lt;/span&gt;&lt;br /&gt;The method attribute specifies which of two permitted HTTP methods will be used to pass the contents of a form. The more commonly used post method submits the contents of the form in a two step procedure. First the URL specified by the action attribute is contacted. Second, if the contact is successful, the contents are transmitted to the URL. The get method appends the contents to the end of the URL specified by the action attribute. (A question mark is used to delimit the end of the URL and the start of the contents.)&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;name&lt;/span&gt;&lt;br /&gt;The name attribute is a string of characters that is used to label a form control (field) with a name. The name must be unique to that document and cannot be reused.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;onreset&lt;/span&gt;&lt;br /&gt;The onreset attribute is an event that allows the execution of JavaScript code when the user resets (clears) the form.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;onsubmit&lt;/span&gt;&lt;br /&gt;The onsubmit attribute is an event that allows the execution of JavaScript code when the user submits the form. For example, you could call a JavaScript function that performs client-side form verification to ensure that the form is filled out correctly (see code example).&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;target&lt;/span&gt;&lt;br /&gt;The target attribute is used to submit the contents of the form to a specified window or frame.&lt;br /&gt; &lt;br /&gt;Here is a sample form that includes client-side verification of fields.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-7939912188196948671?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/7939912188196948671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/form-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7939912188196948671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7939912188196948671'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/form-tag.html' title='FORM tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-8498007355888359709</id><published>2009-02-19T20:33:00.000-08:00</published><updated>2009-02-19T20:46:53.994-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='INPUT tag'/><title type='text'>INPUT tag</title><content type='html'>Available in versions: 2.0, 3.2, 4.0&lt;br /&gt;Browser compatibility: Explorer 4, 5  Netscape 4, 6&lt;br /&gt; &lt;br /&gt;The &lt;input&gt; tag is used to create individual form controls (fields). Control is a technical term that refers to the various elements (buttons, check boxes, radio buttons, text areas) that can be used inside a form to gather information.&lt;br /&gt; &lt;br /&gt;The four tags that can be used to build a form are:&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;button,          input,         select,       textarea&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;The form is the heart of an e-commerce page and the input tag is the heart of a form. There are ten types of form controls that can be created using the input tag. Appropriately, you must use the type attribute to determine the specific type of the control (field). The types are:&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;button&lt;br /&gt;checkbox&lt;br /&gt;file&lt;br /&gt;hidden&lt;br /&gt;image&lt;br /&gt;password&lt;br /&gt;radio&lt;br /&gt;reset&lt;br /&gt;submit&lt;br /&gt;text&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;Any number of input tags can be placed anywhere between a pair of opening and closing form tags to create the desired appearance of the form.&lt;br /&gt; &lt;br /&gt;There is no closing tag.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Core Attributes&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Attributes&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;accept&lt;/span&gt;&lt;br /&gt;The accept attribute is used with the type="file" control to specify what kind of files (including the path) that can be attached to the form. It is a comma-delimited list. For example: accept="images/*.gif"&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;accesskey&lt;/span&gt;&lt;br /&gt;The accesskey attribute allows you to designate a key on the keyboard that when pressed, along with the alt or meta key, will bring focus to the input form element. This attribute is poorly supported.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;align &lt;/span&gt;   deprecated 4.0&lt;br /&gt;The align attribute is used with a type="image" control to place the image with respect to any surrounding text. The permitted values are bottom, left. middle, right, and top. This attribute is deprecated effective with version 4.0. However, most browsers continue to recognize this attribute. You are now to use style sheets.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;alt&lt;/span&gt;&lt;br /&gt;The alt attribute displays an alternative text for browsers that cannot display an image.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;checked&lt;/span&gt;&lt;br /&gt;The checked attribute is a Boolean value that, if present, allows a checkbox or radio button to be preselected (and have a preselected value).&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;disabled&lt;/span&gt;&lt;br /&gt;The disabled attribute is a Boolean value that, if present, prevents the form control (field) from functioning. In some browsers, the control (field) will appear to be greyed out.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;ismap&lt;/span&gt;&lt;br /&gt;The ismap attribute is a Boolean value that, when present, signifies that the image is being used as a mouse-clickable server-side image map.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;maxlength&lt;/span&gt;&lt;br /&gt;The maxlength attribute sets the maximum number of characters that can be entered into a one line text window.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;name&lt;/span&gt;&lt;br /&gt;The name attribute is a string of characters that is used to label a form control (field) with a name. The name must be unique to that document and cannot be reused.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;onblur&lt;/span&gt;&lt;br /&gt;The onblur attribute is an event that allows the execution of JavaScript code when an element loses focus (for example, the mouse was clicked onto another element or a tab navigation directed the cursor elsewhere).&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;onchange&lt;/span&gt;&lt;br /&gt;The onchange attribute is an event that allows the execution of JavaScript code when the form control (field) has been changed and loses focus.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;onfocus&lt;/span&gt;&lt;br /&gt;The onfocus attribute is an event that allows the execution of JavaScript code when an element comes into focus (for example, the mouse was clicked onto the element or a tab navigation brought the cursor to the element).&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;onselect&lt;/span&gt;&lt;br /&gt;The onselect attribute is an event that allows the execution of JavaScript code when the form control (field) gains focus.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;readonly&lt;/span&gt;&lt;br /&gt;The readonly attribute allows you to display a value in a form control (field) that cannot be changed by the user.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;size&lt;/span&gt;&lt;br /&gt;The size attribute sets the width of a one line text window by defining how many characters can fit in the window.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;src&lt;/span&gt;&lt;br /&gt;The src attribute is the URL address or directory/file (path/name) where an image file is being stored.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;tabindex&lt;/span&gt;&lt;br /&gt;The tabindex attribute specifies an integer that defines the rank in the tabbing order for the specified element when you use the keyboard to navigate (tab through) a page. This attribute is poorly supported.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt;&lt;br /&gt;The type attribute determines the specific control.&lt;br /&gt; &lt;br /&gt;Note that by using style sheets you can effect the appearance of the various types of controls. However, the exact appearance will be browser dependent.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;type="button"&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The type="button" control creates a rectangular button that can be clicked when you wish a desired action to occur. For example, you could use buttons to navigate through a recordset data source being displayed on a web page. (See the RDS objects in the ADO Quick Reference.) If you want to reset or submit the form, you should use the type="reset" and type="submit" controls.&lt;br /&gt; &lt;br /&gt;A value for the name attribute is required. You can use the value attribute to assign a text that will be displayed on the face of the button. The default color is gray, but that can be changed using style sheets (see example at bottom of page). The text displayed on the button will set the minimum size, but you can set a different size using style sheets or the size attribute.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-8498007355888359709?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/8498007355888359709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/input-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8498007355888359709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8498007355888359709'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/input-tag.html' title='INPUT tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-7689945127622142652</id><published>2009-02-19T20:30:00.000-08:00</published><updated>2009-02-19T20:33:09.252-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Frames'/><title type='text'>Frames</title><content type='html'>Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles is called a "frame". Frames are very popular because they are one of the few ways to keep part of the page stationary while other parts change. Frames are also one of the most controversial uses of HTML, because of the way the frames concept was designed, and because many web framed web sites are poorly implemented.&lt;br /&gt;&lt;br /&gt;We start off this section with a tutorial on creating frames. We'll start with a simple set of frames, move into more advanced frames pages, and then show some special techniques for using frames.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-7689945127622142652?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/7689945127622142652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/frames.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7689945127622142652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7689945127622142652'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/frames.html' title='Frames'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-5603279258091209594</id><published>2009-02-19T20:26:00.000-08:00</published><updated>2009-02-19T20:30:20.132-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Frameset tag'/><title type='text'>Frameset tag</title><content type='html'>The splitting of a browser screen into frames can be done by using Frameset and /Frameset tags.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt; Attributes of Frameset tag&lt;/span&gt; :&lt;br /&gt;          Frameset tags require one of the following attributes depending on whether to divide the screen in rows or columns.&lt;br /&gt;   &lt;span style="font-weight:bold;"&gt; Rows&lt;/span&gt;: This attribute is used to divide the screen horizontally i.e, into multiple rows. Multiple values can be set to this property depending on the required size of each row. Possible values for this attribute are&lt;br /&gt;         Number of pixels or can be expressed as a percentage of the screen resolution&lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;  Note&lt;/span&gt;: The symbol * indicates the remaining space.&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-weight:bold;"&gt;Cols&lt;/span&gt;: This attribute is used to divide the screen vertically i.e, into multiple columns. Multiple values can be set to this property depending on the required size of each column. Possible values for this attribute are&lt;br /&gt;         Number of pixels or can be expressed as a percentage of the screen resolution&lt;br /&gt;    &lt;span style="font-weight:bold;"&gt;Note&lt;/span&gt;: The symbol * indicates the remaining space.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;:&lt;br /&gt;       Frameset rows="30%,30%,*"               &lt;br /&gt;          ... Rest of the definition here ...&lt;br /&gt;      /Frameset&lt;br /&gt;&lt;br /&gt;Note: There are several advantages(pros) and disadvantages(cons) of using frames. Now you will be eager to see the advantages and disadvantages of frames.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-5603279258091209594?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/5603279258091209594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/frameset-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/5603279258091209594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/5603279258091209594'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/frameset-tag.html' title='Frameset tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-4781021424079776816</id><published>2009-02-19T20:09:00.000-08:00</published><updated>2009-02-19T20:20:35.635-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Frame tag'/><title type='text'>Frame  tag</title><content type='html'>The frame  tag is used to load different documents into each unique section that is been defined after the browser screen has been divided into rows and columns using frameset tag.&lt;br /&gt;Note: Frame tag does not have any closing tag.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Attributes of Frame tag :&lt;/span&gt;&lt;br /&gt;     &lt;span style="font-weight:bold;"&gt;src&lt;/span&gt;: Specifies the url of the document to be loaded into the frame.&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-weight:bold;"&gt; MarginWidth&lt;/span&gt;:  Specifies  the amount of space to be left along the sides of the frame.&lt;br /&gt;&lt;br /&gt;     &lt;span style="font-weight:bold;"&gt;MarginHeight&lt;/span&gt;:  Specifies  the amount of space to be left at the top and bottom of the frame.&lt;br /&gt;&lt;br /&gt;     Name: Used to give a unique name for the frame. The name must begin with an alphanumeric character.&lt;br /&gt;&lt;br /&gt;     &lt;span style="font-weight:bold;"&gt;NoResize&lt;/span&gt;: Disables the resizing capability of the frame.&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-weight:bold;"&gt; Scrolling&lt;/span&gt;: This is used to decide whether to have scrollbars (Horizontal , Vertical) in a frame. This possibly take 3 values Yes , No or Auto.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;:&lt;br /&gt;       Frameset rows="50%,50%"              &lt;br /&gt;            Frame src="frame1src.html" &lt;br /&gt;            Frame src="frame2src.html"&lt;br /&gt;     /Frameset&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-4781021424079776816?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/4781021424079776816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/frame-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4781021424079776816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4781021424079776816'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/frame-tag.html' title='Frame  tag'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-9016937017383668191</id><published>2009-02-04T23:02:00.001-08:00</published><updated>2009-02-04T23:02:56.621-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What Is PHP?'/><title type='text'>What Is PHP?</title><content type='html'>The endless possibilities of the PHP scripting language and a great community of users has made it one of the most popular open-source languages. For all you people living outside the UNIX world, Open Source means it doesn't cost anything. You can use it as much as you want and where you want, and nobody will ever charge you thousands of dollars for licenses and support. Even though it was originally conceived as a set of macros to help coders maintain personal home pages, its name grew a lot more from its purpose. Since then, PHP's capabilities have been extended, taking it beyond a set of utilities to a full-featured programming language, capable of managing huge database-driven online environments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-9016937017383668191?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/9016937017383668191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/what-is-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/9016937017383668191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/9016937017383668191'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/what-is-php.html' title='What Is PHP?'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-1943302320291399289</id><published>2009-02-04T22:58:00.000-08:00</published><updated>2009-02-04T23:02:23.089-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP scripting'/><title type='text'>PHP scripting</title><content type='html'>PHP is now officially known as "PHP: HyperText Preprocessor". It is a server-side scripting language usually written in an HTML context. Unlike an ordinary HTML page, a PHP script is not sent directly to a client by the server; instead, it is parsed by the PHP binary or module, which is server-side installed. HTML elements in the script are left alone, but PHP code is interpreted and executed. PHP code in a script can query databases, create images, read and write files, talk to remote servers - the possibilities are endless. The output from PHP code is combined with the HTML in the script and the result sent to the user?s web-browser, therefore it can never tell the user whether the web-server uses PHP or not, because all the browser sees is HTML.&lt;br /&gt;&lt;br /&gt;PHP's support for Apache and MySQL further increases its popularity. Apache is now the most-used web-server in the world, and PHP can be compiled as an Apache module. MySQL is a powerful free SQL database, and PHP provides a comprehensive set of functions for working with it. The combination of Apache, MySQL and PHP is all but unbeatable.&lt;br /&gt;&lt;br /&gt;That doesn?t mean that PHP cannot work in other environments or with other tools. In fact, PHP supports an extensive list of databases and web-servers. The rise in popularity of PHP has coincided with a change of approach in web-publishing. While in the mid-1990s it was ok to build sites, even relatively large sites, with hundreds of individual hard-coded HTML pages, today?s webmasters are making the most of the power of databases to manage their content more effectively and to personalize their sites according to individual user preferences.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-1943302320291399289?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/1943302320291399289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/php-scripting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1943302320291399289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1943302320291399289'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/php-scripting.html' title='PHP scripting'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-8770123735417417558</id><published>2009-02-04T22:57:00.000-08:00</published><updated>2009-02-04T22:58:53.013-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Why Use PHP?'/><title type='text'>Why Use PHP?</title><content type='html'>If you need to embed dynamic text into static text, you’ll find PHP extremely useful. It was designed for this, and it excels at it. PHP is also very useful for integrating web pages with databases.&lt;br /&gt;&lt;br /&gt;The PHP scripting language resembles JavaScript, Java, and Perl, These languages all share a common ancestor, the C programming language.&lt;br /&gt;&lt;br /&gt;PHP is most different from JavaScript and Java. PHP is a server-side scripting language. All of the “work” is done on the server. JavaScript (and Java) generally run on the client. They have little access to the information that the server has, and mediated access to information on the client. They can do lots of things on the client that PHP cannot. PHP has full access to the information that the server has, and very little access to information that the client has. In fact, it only has information that the client tells the server and that the server passes on to PHP. Because it is on the server, however, PHP cannot be modified by the client. While you cannot necessarily trust the information that the client gives to PHP, you can trust that your PHP is doing what you told it to do. Because PHP is on the server end, your PHP scripts can affect your server--such as by keeping an activity log or updating a database.&lt;br /&gt;&lt;br /&gt;PHP and Perl often work side-by-side. These are both server-side. Where PHP excels at embedding dynamic content, Perl excels at modifying (or “filtering”) streams of text. PHP excels at putting things into documents, and Perl excels at finding things in documents. After you have learned PHP, you may well find Perl useful for many tasks, especially for command-line tasks. PHP has an advantage over Perl on most web sites because PHP is usually loaded as part of the web server. When scripting languages “run”, the system has to first load the “interpreter” and then “compile” the language into code that the machine can understand. When you tell PHP to echo the current time to the web page, the computer needs to have your command translated into numbers that it can understand. Because the PHP interpreter is already loaded as part of the web server’s software, it is always running. This cuts out half of that process. The interpreter is already loaded, and it can go directly to compiling the language into code. When web servers see a request to run a Perl script, they usually have to first load the Perl interpreter. This happens very quickly, but when there are thousands or tens of thousands of requests coming every second, every “very quickly” can add up.&lt;br /&gt;&lt;br /&gt;C programs are “pre-compiled”. They cut out both steps in that process: no interpreter is needed because the program is already compiled into code the machine understands. Because of this, however, C programs must be compiled every time you switch to a new machine. If you move to a different host, you will usually have to recompile your C programs. Sometimes you’ll even have to recompile your C programs when your ISP upgrades their server’s system software. And many ISPs do not provide you with a C compiler. You’ll find that PHP is more “portable” than C in this respect: if it works on one server, it will usually work on any other server that has it. Most ISPs that provide server-side scripting provide PHP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-8770123735417417558?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/8770123735417417558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/why-use-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8770123735417417558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8770123735417417558'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/why-use-php.html' title='Why Use PHP?'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-3876804768786416556</id><published>2009-02-04T22:52:00.000-08:00</published><updated>2009-02-04T22:57:02.448-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='structure of php'/><title type='text'>structure of php</title><content type='html'>&lt;?php&lt;br /&gt;print "Hello Web!";&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;In this simple script you can see some of the most used components of a PHP script. First off, PHP tags are used to separate the actual PHP content from the rest of the file. You can inform the interpreter that you want it to execute your commands by adding a pair of these: standard tags "&lt;?php ?&gt;"; short tags "&lt;? ?&gt;"; ASP tags "&lt;% %&gt;"; script tags "&lt;SCRIPT LANGUAGE="php"&gt; &lt;/SCRIPT&gt;". The standard and the script tags are guaranteed to work under any configuration, the other two need to be enabled in your "php.ini"&lt;br /&gt;&lt;br /&gt;Now that you know how to define a block of PHP code, take a closer look at the code above. The "print" function is used to output data, so anything output by "print()" ends up in the HTML file. Therefore, you can say that a function is a command that performs an action. Usually, you send some data to the function, and the function uses that data to come up with a result. There are a lot functions in PHP, and almost each one performs a different action. Data sent to a function is almost always placed in parentheses after the function name; there are some exceptions where parentheses are optional, and the "print()" function is one of them.&lt;br /&gt;&lt;br /&gt;After that first line of code, you can see a semicolon. This semicolon informs the interpreter that you have completed a statement - a statement is to PHP what a sentence is to the English language. It represents an instruction to the interpreter, and some additional data. If PHP doesn't find a semicolon at the end of your statement, then it will continue parsing the file until it finds one, ignoring any white-spaces or empty lines. So, your one statement doesn't necessarily have to use only one line of code. There can be two or more statements on a single line, but, on the other hand, a statement could use two or more lines. PHP also ignores white spaces, so you can have as many blanks as you want between the statements, and between the statements' parameters. You should know that you don't have to use a semicolon with the last statement in your script (just before the closing tag). So the following scripts are equivalent:&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;print "This is a test" ;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php print "This is a test" ?&gt;&lt;br /&gt;&lt;br /&gt;Commenting you PHP code can be very helpful. If some code seems to be very clear at the time of writing, the same code can look like a black hole a few weeks later, when you want to modify it. So adding comments to your code can save you time later on, and make it easier for other people to work with your code. But, wait, what is a comment? A comment is a text in a script that is ignored by the interpreter. So you can write anything you want in it, from copyright notices to detailed information about your code. PHP recognizes a comment by checking out if it contains two forward slashes ("//") or a single hash sign ("#"). The text beginning from either of these marks until the end of the line is ignored. You can also use multi-line comments. They begin with a forward slash followed by an asterisk ("/*") and end with an asterisk followed by a forward slash ("*/"):&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;/*&lt;br /&gt;This is a demo script.&lt;br /&gt;All it does is output Hello Web! in your browser.&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;print "Hello Web!"; //outputs a message&lt;br /&gt;&lt;br /&gt;//copyright (C) SoftwareProjects.org 2004&lt;br /&gt;?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-3876804768786416556?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/3876804768786416556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/structure-of-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3876804768786416556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3876804768786416556'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/structure-of-php.html' title='structure of php'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-6857917240955276123</id><published>2009-02-04T22:48:00.000-08:00</published><updated>2009-02-04T22:52:08.490-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='The If Statement'/><title type='text'>The If Statement</title><content type='html'>The PHP if statement is very similar to other programming languages use of the if statement, but for those who are not familiar with it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Think about the decisions you make before you go to sleep. If you have something to do the next day, say go to work, school, or an appointment, then you will set your alarm clock to wake you up. Otherwise, you will sleep in as long as you like!&lt;br /&gt;&lt;br /&gt;This simple kind of if/then statement is very common in every day life and also appears in programming quite often. Whenever you want to make a decision given that something is true (you have something to do tomorrow) and be sure that you take the appropriate action, you are using an if/then relationship.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The if statement is necessary for most programming, thus it is important in PHP. Imagine that on January 1st you want to print out "Happy New Year!" at the top of your personal web page. With the use of PHP if statements you could have this process automated, months in advance, occuring every year on January 1st.&lt;br /&gt;&lt;br /&gt;This idea of planning for future events is something you would never have had the opportunity of doing if you had just stuck with HTML.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;If Statement Example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The "Happy New Year" example would be a little difficult for you to do right now, so let us instead start off with the basics of the if statement. The PHP if statement tests to see if a value is true, and if it is a segment of code will be executed. See the example below for the form of a PHP if statement.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$my_name = "someguy";&lt;br /&gt;&lt;br /&gt;if ( $my_name == "someguy" ) {&lt;br /&gt; echo "Your name is someguy!&lt;br /&gt;";&lt;br /&gt;}&lt;br /&gt;echo "Welcome to my homepage!";&lt;br /&gt;&lt;br /&gt;Display:&lt;br /&gt;Your name is someguy!&lt;br /&gt;Welcome to my homepage!&lt;br /&gt;&lt;br /&gt;Did you get that we were comparing the variable $my_name with "someguy" to see if they were equal? In PHP you use the double equal sign (==) to compare values. Additionally, notice that because the if statement turned out to be true, the code segment was executed, printing out "Your name is someguy!". Let's go a bit more in-depth into this example to iron out the details.&lt;br /&gt;&lt;br /&gt;    * We first set the variable $my_name equal to "someguy".&lt;br /&gt;    * We next used a PHP if statement to check if the value contained in the variable $my_name was equal to "someguy"&lt;br /&gt;    * The comparison between $my_name and "someguy" 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;br /&gt;    * Translated into english the PHP statement ( $my_name == "someguy" ) is ( $my_name is equal to "someguy" ).&lt;br /&gt;    * $my_name is indeed equal to "someguy" so the echo statement is executed.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;A False If Statement&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let us now see what happens when a PHP if statement is not true, in other words, false. Say that we changed the above example to:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$my_name = "anotherguy";&lt;br /&gt;&lt;br /&gt;if ( $my_name == "someguy" ) {&lt;br /&gt; echo "Your name is someguy!&lt;br /&gt;";&lt;br /&gt;}&lt;br /&gt;echo "Welcome to my homepage!";&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-6857917240955276123?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/6857917240955276123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/if-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/6857917240955276123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/6857917240955276123'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/if-statement.html' title='The If Statement'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-45844738637009096</id><published>2009-02-04T22:44:00.000-08:00</published><updated>2009-02-04T22:46:11.183-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Variables'/><title type='text'>Variables</title><content type='html'>In this Tutorial you'll learn about Variables and different Data Types in PHP. This includes - what is a variable, naming conventions of a variable in PHP, various data types namely, String, Numeric and Array data types.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;What is a Variable?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              Variables are nothing but identifiers to the memory location to store data. We can create any number of varibles. In PHP all the variables begin with a dollar sign "$" and the value can be assignes using the "=" operator as shown below:&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;$Name, $Name1, $First_Name, $Last_Name&lt;br /&gt;&lt;br /&gt;$Name = "David";&lt;br /&gt;&lt;br /&gt;$Age = 16;&lt;br /&gt;&lt;br /&gt;              Another important thing in PHP is that all the statements must end with a semicolon ";". In PHP we needn't have to specify the variable type, as it takes the data type of the assigned value. From the above example we understand that '$Name' is of Data type String and '$Age' is of type Numeric.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Limitations in Variable Naming:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              PHP has no limit on the length of variable name as in the case of other programming languages. The variable name must start with a letter or underscore. The variable name must be a combination of letters, numbers and underscores. Other characters such as *, +, #, @ are not allowed and causes error if used.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Data Types in PHP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In PHP the data type of a variable is not set by the programmer. PHP decides the data type of variables after interpreting the web page. Data Types in PHP include:&lt;br /&gt;&lt;br /&gt;    * Numeric data type&lt;br /&gt;    * String data type&lt;br /&gt;    * Array data type&lt;br /&gt;&lt;br /&gt;Numeric data type&lt;br /&gt;&lt;br /&gt;Numeric data type is used for number. There are two different numeric data types:&lt;br /&gt;&lt;br /&gt;    * Integer&lt;br /&gt;    * Double&lt;br /&gt;&lt;br /&gt;Integer Data Type&lt;br /&gt;&lt;br /&gt;       Integer data types contain whole number values.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;$intmark = 100;&lt;br /&gt;&lt;br /&gt;Doubles&lt;br /&gt;&lt;br /&gt;      Double contains floating point numbers.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;$doubtotal = 99.5;&lt;br /&gt;&lt;br /&gt;String Data Type&lt;br /&gt;&lt;br /&gt;     String data type is used to contain textual information or letters. The value is assigned within quotes as shown below.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;$strName = "David";&lt;br /&gt;&lt;br /&gt;$strId = "David123";&lt;br /&gt;&lt;br /&gt;String Concatenation&lt;br /&gt;&lt;br /&gt;String Concatenation is a process of adding two strings. This is done by attaching one string to the end of another string. This is done by using '.' (period) operator as shown below:&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;$strFirst_Name = "David";&lt;br /&gt;&lt;br /&gt;$strSpace = " ";&lt;br /&gt;&lt;br /&gt;$strLast_Name = "John";&lt;br /&gt;&lt;br /&gt;$strName = $strFirst_Name.$strSpace.$strLast_Name;&lt;br /&gt;&lt;br /&gt;echo $strName;&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;David John&lt;br /&gt;&lt;br /&gt;Array Data Type&lt;br /&gt;&lt;br /&gt;Array data type is used to contain many values in a single variable. Each array element can be retrieved by using the array variable name and its key/index value. We can declare an array variable in different ways as shown below:&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;$arrMark[0] = 95;&lt;br /&gt;&lt;br /&gt;$arrMark[1] = 88;&lt;br /&gt;&lt;br /&gt;$arrMark[3] = 77;&lt;br /&gt;&lt;br /&gt;(Or)&lt;br /&gt;&lt;br /&gt;$arrMark = array(95,88,77);&lt;br /&gt;&lt;br /&gt;In the above example, the variable 'arrMark' contains three different values. In the first method the array elements are stored using the key values (0, 1, 2), but in the second example the keyword 'array' is used to assign values to the array variable. By default, array key element starts with 0.&lt;br /&gt;&lt;br /&gt;The array elements can be accessed by using their key values. The different marks stored in the array elements can be added together to obtain the total marks as shown below:&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;$intTotalMark = $arrMark[0] + $arrMark[1] + $arrMark[2];&lt;br /&gt;&lt;br /&gt;echo $intTotalMark;&lt;br /&gt;&lt;br /&gt;Output: 260&lt;br /&gt;&lt;br /&gt;In the above two examples we have used the key values as numbers, but it not necessary that the key value must be a number, it can also be a string as shown below:&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;$arrMark['maths'] = 95;&lt;br /&gt;&lt;br /&gt;$arrMark['english'] = 88;&lt;br /&gt;&lt;br /&gt;$arrMark['science'] = 77;&lt;br /&gt;&lt;br /&gt;$intTotalMark = $arrMark['maths'] + $arrMark['english']+$arrMark['science'];&lt;br /&gt;&lt;br /&gt;echo $intTotalMark;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-45844738637009096?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/45844738637009096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/variables.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/45844738637009096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/45844738637009096'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/variables.html' title='Variables'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-3563043424980050982</id><published>2009-02-04T22:39:00.000-08:00</published><updated>2009-02-04T22:43:50.991-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Application Variables in PHP'/><title type='text'>Application Variables in PHP</title><content type='html'>In July, 2002, I moved the leosolutions.com web site from a Microsoft IIS web server to a Linux server running Apache to reduce the monthly cost of web hosting. After many years of developing in Microsoft Active Server Pages, the conversion from ASP to PHP was surprisingly easy - nearly every statment in ASP has a one-to-one correspondence with its PHP equivalent. However, I encountered one major problem during the conversion process: PHP has no couterpart for application variables in ASP.&lt;br /&gt;&lt;br /&gt;Application variables in ASP work very similar to the $_SESSION variable in PHP. However, unlike the $_SESSION variable, application variables are not specific to an individual user; they persist across every user of every page on the web site.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Benefits&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The immediate benefits of application variables may not be apparent, but esperienced ASP coders understand their power. Take this one-liner, for example:&lt;br /&gt;&lt;br /&gt;You are visitor number&lt;br /&gt;&lt;?php echo $_APP["visitor_count"]++; ?&gt;&lt;br /&gt;to this web site.&lt;br /&gt;&lt;br /&gt;Application variables have many other purposes. On the leosolutions.com web site, I used them primarily to cache common dynamically-generated parts of the page, such as the menu bars and project tab. (Yes, the menu bars on my are dynamically generated from a database) Since this content doesn't change often, it would be a waste of resources (and cause slower response times) to generate these elements on-the-fly, each time a page was requested. Instead, the PHP script checks the application variables for the element. If it is found, the PHP script simply sends the HTML code stored in the application variable directly to the output. Otherwise, the content is generated from the database, and stored to the application variables for future use.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I looked on the web and read numerous other work-arounds for application variables in PHP, but found none that I liked. Every one required too much overhead code, or else multiple lines of code to actually use the variables. Here is my solution:&lt;br /&gt;&lt;br /&gt;app.php&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;define("APP_DATA_FILE",&lt;br /&gt;    "/tmp/application.data");&lt;br /&gt;&lt;br /&gt;function application_start ()&lt;br /&gt;{&lt;br /&gt;    global $_APP;&lt;br /&gt;&lt;br /&gt;    // if data file exists, load application&lt;br /&gt;    //   variables&lt;br /&gt;    if (file_exists(APP_DATA_FILE))&lt;br /&gt;    {&lt;br /&gt;        // read data file&lt;br /&gt;        $file = fopen(APP_DATA_FILE, "r");&lt;br /&gt;        if ($file)&lt;br /&gt;        {&lt;br /&gt;            $data = fread($file,&lt;br /&gt;                filesize(APP_DATA_FILE));&lt;br /&gt;            fclose($file);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        // build application variables from&lt;br /&gt;        //   data file&lt;br /&gt;        $_APP = unserialize($data);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function application_end ()&lt;br /&gt;{&lt;br /&gt;    global $_APP;&lt;br /&gt;&lt;br /&gt;    // write application data to file&lt;br /&gt;    $data = serialize($_APP);&lt;br /&gt;    $file = fopen(APP_DATA_FILE, "w");&lt;br /&gt;    if ($file)&lt;br /&gt;    {&lt;br /&gt;        fwrite($file, $data);&lt;br /&gt;        fclose($file);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Usage&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The usage of the $_APP variable is very similar to $_SESSION. Before using it on a page, you must include app.php and call application_start(). When you are finished, you must call application_end().&lt;br /&gt;&lt;br /&gt;Sample PHP file using application variables:&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;include("app.php");&lt;br /&gt;application_start();&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt; html&gt;&lt;br /&gt;&lt; body&gt;&lt;br /&gt;You are visitor number&lt;br /&gt;&lt;?php echo $_APP["visitor_count"]++; ?&gt;&lt;br /&gt;to this web site.&lt;br /&gt;&lt; /body&gt;&lt;br /&gt;&lt; /html&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;application_end();&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Optimizations and Other Notes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Numerous improvements can be made to this code, but they are not included here for simplicity.&lt;br /&gt;&lt;br /&gt;    * For added security, permissions on the application data file should not allow any user, except for the web server, to read or write to it. Otherwise, if application variables contained sensitive data, such as passwords or credit card information, other users on the system could read this data.&lt;br /&gt;    * To keep from writing to disk unnecessarily, only call application_end() if data in the $_APP variable has changed.&lt;br /&gt;    * Another alternative is to let the application_end() function determine whether the $_APP variable has been changed, and only write it to disk if necessary. Simply make a copy of the $_APP variable in application_start(), then compare $_APP to the original in application_end().&lt;br /&gt;    * Finally, don't forget that unlike $_SESSION, the $_APP variable is only available in the global scope. When using $_APP from inside a function, be sure to include the statement global $_APP; at the top of the function.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-3563043424980050982?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/3563043424980050982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/application-variables-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3563043424980050982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3563043424980050982'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/application-variables-in-php.html' title='Application Variables in PHP'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-7954917454130087848</id><published>2009-02-04T22:16:00.000-08:00</published><updated>2009-02-04T22:39:45.202-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Arrays'/><title type='text'>Arrays</title><content type='html'>As we discussed in Chapter 2, PHP supports both scalar and compound data types. In this chapter, we'll discuss one of the compound types: arrays. An array is a collection of data values, organized as an ordered collection of key-value pairs.&lt;br /&gt;&lt;br /&gt;This chapter talks about creating an array, adding and removing elements from an array, and looping over the contents of an array. There are many built-in functions that work with arrays in PHP, because arrays are very common and useful. For example, if you want to send email to more than one email address, you'll store the email addresses in an array and then loop through the array, sending the message to the current email address. Also, if you have a form that permits multiple selections, the items the user selected are returned in an array.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Indexed Versus Associative Arrays&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are two kinds of arrays in PHP: indexed and associative. The keys of an indexed array are integers, beginning at 0. Indexed arrays are used when you identify things by their position. Associative arrays have strings as keys and behave more like two-column tables. The first column is the key, which is used to access the value.&lt;br /&gt;&lt;br /&gt;PHP internally stores all arrays as associative arrays, so the only difference between associative and indexed arrays is what the keys happen to be. Some array features are provided mainly for use with indexed arrays, because they assume that you have or want keys that are consecutive integers beginning at 0. In both cases, the keys are unique--that is, you can't have two elements with the same key, regardless of whether the key is a string or an integer.&lt;br /&gt;&lt;br /&gt;PHP arrays have an internal order to their elements that is independent of the keys and values, and there are functions that you can use to traverse the arrays based on this internal order. The order is normally that in which values were inserted into the array, but the sorting functions described later let you change the order to one based on keys, values, or anything else you choose.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Identifying Elements of an Array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can access specific values from an array using the array variable's name, followed by the element's key (sometimes called the index) within square brackets:&lt;br /&gt;&lt;br /&gt;$age['Fred']&lt;br /&gt;$shows[2]&lt;br /&gt;&lt;br /&gt;The key can be either a string or an integer. String values that are equivalent to integer numbers (without leading zeros) are treated as integers. Thus, $array[3] and $array['3'] reference the same element, but $array['03'] references a different element. Negative numbers are valid keys, and they don't specify positions from the end of the array as they do in Perl.&lt;br /&gt;&lt;br /&gt;You don't have to quote single-word strings. For instance, $age['Fred'] is the same as $age[Fred]. However, it's considered good PHP style to always use quotes, because quoteless keys are indistinguishable from constants. When you use a constant as an unquoted index, PHP uses the value of the constant as the index:&lt;br /&gt;&lt;br /&gt;define('index',5);&lt;br /&gt;echo $array[index];               // retrieves $array[5], not $array['index'];&lt;br /&gt;&lt;br /&gt;You must use quotes if you're using interpolation to build the array index:&lt;br /&gt;&lt;br /&gt;$age["Clone$number"]&lt;br /&gt;&lt;br /&gt;However, don't quote the key if you're interpolating an array lookup:&lt;br /&gt;&lt;br /&gt;// these are wrong&lt;br /&gt;print "Hello, $person['name']";&lt;br /&gt;print "Hello, $person["name"]";&lt;br /&gt;// this is right&lt;br /&gt;print "Hello, $person[name]";&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Storing Data in Arrays&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Storing a value in an array will create the array if it didn't already exist, but trying to retrieve a value from an array that hasn't been defined yet won't create the array. For example:&lt;br /&gt;&lt;br /&gt;// $addresses not defined before this point&lt;br /&gt;echo $addresses[0];                    // prints nothing&lt;br /&gt;echo $addresses;                       // prints nothing&lt;br /&gt;$addresses[0] = 'spam@cyberpromo.net';&lt;br /&gt;echo $addresses;                       // prints "Array"&lt;br /&gt;&lt;br /&gt;Using simple assignment to initialize an array in your program leads to code like this:&lt;br /&gt;&lt;br /&gt;$addresses[0] = 'spam@cyberpromo.net';&lt;br /&gt;$addresses[1] = 'abuse@example.com';&lt;br /&gt;$addresses[2] = 'root@example.com';&lt;br /&gt;// ...&lt;br /&gt;&lt;br /&gt;That's an indexed array, with integer indexes beginning at 0. Here's an associative array:&lt;br /&gt;&lt;br /&gt;$price['Gasket'] = 15.29;&lt;br /&gt;$price['Wheel']  = 75.25;&lt;br /&gt;$price['Tire']   = 50.00;&lt;br /&gt;// ...&lt;br /&gt;&lt;br /&gt;An easier way to initialize an array is to use the array( ) construct, which builds an array from its arguments:&lt;br /&gt;&lt;br /&gt;$addresses = array('spam@cyberpromo.net', 'abuse@example.com',&lt;br /&gt;                  'root@example.com');&lt;br /&gt;&lt;br /&gt;To create an associative array with array( ), use the =&gt; symbol to separate indexes from values:&lt;br /&gt;&lt;br /&gt;$price = array('Gasket' =&gt; 15.29,&lt;br /&gt;              'Wheel'  =&gt; 75.25,&lt;br /&gt;              'Tire'   =&gt; 50.00);&lt;br /&gt;&lt;br /&gt;Notice the use of whitespace and alignment. We could have bunched up the code, but it wouldn't have been as easy to read:&lt;br /&gt;&lt;br /&gt;$price = array('Gasket'=&gt;15.29,'Wheel'=&gt;75.25,'Tire'=&gt;50.00);&lt;br /&gt;&lt;br /&gt;To construct an empty array, pass no arguments to array( ):&lt;br /&gt;&lt;br /&gt;$addresses = array(  );&lt;br /&gt;&lt;br /&gt;You can specify an initial key with =&gt; and then a list of values. The values are inserted into the array starting with that key, with subsequent values having sequential keys:&lt;br /&gt;&lt;br /&gt;$days = array(1 =&gt; 'Monday',   'Tuesday', 'Wednesday',&lt;br /&gt;                  'Thursday', 'Friday',  'Saturday', 'Sunday');&lt;br /&gt;// 2 is Tuesday, 3 is Wednesday, etc.&lt;br /&gt;&lt;br /&gt;If the initial index is a non-numeric string, subsequent indexes are integers beginning at 0. Thus, the following code is probably a mistake:&lt;br /&gt;&lt;br /&gt;$whoops = array('Friday' =&gt; 'Black', 'Brown', 'Green');&lt;br /&gt;// same as&lt;br /&gt;$whoops = array('Friday' =&gt; 'Black', 0 =&gt; 'Brown', 1 =&gt; 'Green');&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Adding Values to the End of an Array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To insert more values into the end of an existing indexed array, use the [] syntax:&lt;br /&gt;&lt;br /&gt;$family = array('Fred', 'Wilma');&lt;br /&gt;$family[] = 'Pebbles';                 // $family[2] is 'Pebbles'&lt;br /&gt;&lt;br /&gt;This construct assumes the array's indexes are numbers and assigns elements into the next available numeric index, starting from 0. Attempting to append to an associative array is almost always a programmer mistake, but PHP will give the new elements numeric indexes without issuing a warning:&lt;br /&gt;&lt;br /&gt;$person = array('name' =&gt; 'Fred');&lt;br /&gt;$person[] = 'Wilma';                   // $person[0] is now 'Wilma'&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Assigning a Range of Values&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The range( ) function creates an array of consecutive integer or character values between the two values you pass to it as arguments. For example:&lt;br /&gt;&lt;br /&gt;$numbers = range(2, 5);                // $numbers = array(2, 3, 4, 5);&lt;br /&gt;$letters = range('a', 'z');            // $numbers holds the alphabet&lt;br /&gt;$reversed_numbers = range(5, 2);       // $numbers = array(5, 4, 3, 2);&lt;br /&gt;&lt;br /&gt;Only the first letter of a string argument is used to build the range:&lt;br /&gt;&lt;br /&gt;range('aaa', 'zzz')                    /// same as range('a','z')&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Getting the Size of an Array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The count( ) and sizeof( ) functions are identical in use and effect. They return the number of elements in the array. There is no stylistic preference about which function you use. Here's an example:&lt;br /&gt;&lt;br /&gt;$family = array('Fred', 'Wilma', 'Pebbles');&lt;br /&gt;$size = count($family);              // $size is 3&lt;br /&gt;&lt;br /&gt;These functions do not consult any numeric indexes that might be present:&lt;br /&gt;&lt;br /&gt;$confusion = array( 10 =&gt; 'ten', 11 =&gt; 'eleven', 12 =&gt; 'twelve');&lt;br /&gt;$size = count($confusion);      // $size is 3&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Padding an Array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To create an array initialized to the same value, use array_pad( ). The first argument to array_pad( ) is the array, the second argument is the minimum number of elements you want the array to have, and the third argument is the value to give any elements that are created. The array_pad( ) function returns a new padded array, leaving its argument array alone.&lt;br /&gt;&lt;br /&gt;Here's array_pad( ) in action:&lt;br /&gt;&lt;br /&gt;$scores = array(5, 10);&lt;br /&gt;$padded = array_pad($scores, 5, 0);    // $padded is now array(5, 10, 0, 0, 0)&lt;br /&gt;&lt;br /&gt;Notice how the new values are appended to the end of the array. If you want the new values added to the start of the array, use a negative second argument:&lt;br /&gt;&lt;br /&gt;$padded = array_pad($scores, -5, 0);&lt;br /&gt;&lt;br /&gt;Assign the results of array_pad( ) back to the original array to get the effect of an in situ change:&lt;br /&gt;&lt;br /&gt;$scores = array_pad($scores, 5, 0);&lt;br /&gt;&lt;br /&gt;If you pad an associative array, existing keys will be preserved. New elements will have numeric keys starting at 0.&lt;br /&gt;Multidimensional Arrays&lt;br /&gt;&lt;br /&gt;The values in an array can themselves be arrays. This lets you easily create &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;multidimensional arrays:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$row_0 = array(1, 2, 3);&lt;br /&gt;$row_1 = array(4, 5, 6);&lt;br /&gt;$row_2 = array(7, 8, 9);&lt;br /&gt;$multi = array($row_0, $row_1, $row_2);&lt;br /&gt;&lt;br /&gt;You can refer to elements of multidimensional arrays by appending more []s:&lt;br /&gt;&lt;br /&gt;$value = $multi[2][0];                 // row 2, column 0. $value = 7&lt;br /&gt;&lt;br /&gt;To interpolate a lookup of a multidimensional array, you must enclose the entire array lookup in curly braces:&lt;br /&gt;&lt;br /&gt;echo("The value at row 2, column 0 is {$multi[2][0]}\n");&lt;br /&gt;&lt;br /&gt;Failing to use the curly braces results in output like this:&lt;br /&gt;&lt;br /&gt;The value at row 2, column 0 is Array[0]&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Extracting Multiple Values&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To copy all of an array's values into variables, use the list( ) construct:&lt;br /&gt;&lt;br /&gt;list($variable, ...) = $array;&lt;br /&gt;&lt;br /&gt;The array's values are copied into the listed variables, in the array's internal order. By default that's the order in which they were inserted, but the sort functions described later let you change that. Here's an example:&lt;br /&gt;&lt;br /&gt;$person = array('name' =&gt; 'Fred', 'age' =&gt; 35, 'wife' =&gt; 'Betty');&lt;br /&gt;list($n, $a, $w) = $person;            // $n is 'Fred', $a is 35, $w is 'Betty'&lt;br /&gt;&lt;br /&gt;If you have more values in the array than in the list( ), the extra values are ignored:&lt;br /&gt;&lt;br /&gt;$person = array('name' =&gt; 'Fred', 'age' =&gt; 35, 'wife' =&gt; 'Betty');&lt;br /&gt;list($n, $a) = $person;                // $n is 'Fred', $a is 35&lt;br /&gt;&lt;br /&gt;If you have more values in the list( ) than in the array, the extra values are set to NULL:&lt;br /&gt;&lt;br /&gt;$values = array('hello', 'world');&lt;br /&gt;list($a, $b, $c) = $values;            // $a is 'hello', $b is 'world', $c is NULL&lt;br /&gt;&lt;br /&gt;Two or more consecutive commas in the list( ) skip values in the array:&lt;br /&gt;&lt;br /&gt;$values = range('a', 'e');&lt;br /&gt;list($m,,$n,,$o) = $values;            // $m is 'a', $n is 'c', $o is 'e'&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Slicing an Array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To extract only a subset of the array, use the array_slice( ) function:&lt;br /&gt;&lt;br /&gt;$subset = array_slice(array, offset, length);&lt;br /&gt;&lt;br /&gt;The array_slice( ) function returns a new array consisting of a consecutive series of values from the original array. The offset parameter identifies the initial element to copy (0 represents the first element in the array), and the length parameter identifies the number of values to copy. The new array has consecutive numeric keys starting at 0. For example:&lt;br /&gt;&lt;br /&gt;$people = array('Tom', 'Dick', 'Harriet', 'Brenda', 'Jo');&lt;br /&gt;$middle = array_slice($people, 2, 2); // $middle is array('Harriet', 'Brenda')&lt;br /&gt;&lt;br /&gt;It is generally only meaningful to use array_slice( ) on indexed arrays (i.e., those with consecutive integer indexes, starting at 0):&lt;br /&gt;&lt;br /&gt;// this use of array_slice(  ) makes no sense&lt;br /&gt;$person = array('name' =&gt; 'Fred', 'age' =&gt; 35, 'wife' =&gt; 'Betty');&lt;br /&gt;$subset = array_slice($person, 1, 2);  // $subset is array(0 =&gt; 35, 1 =&gt; 'Betty')&lt;br /&gt;&lt;br /&gt;Combine array_slice( ) with list( ) to extract only some values to variables:&lt;br /&gt;&lt;br /&gt;$order = array('Tom', 'Dick', 'Harriet', 'Brenda', 'Jo');&lt;br /&gt;list($second, $third) = array_slice($order, 1, 2);&lt;br /&gt;// $second is 'Dick', $third is 'Harriet'&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Splitting an Array into Chunks&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To divide an array into smaller, evenly sized arrays, use the array_chunk( ) function:&lt;br /&gt;&lt;br /&gt;$chunks = array_chunk(array, size [, preserve_keys]);&lt;br /&gt;&lt;br /&gt;The function returns an array of the smaller arrays. The third argument, preserve_keys, is a Boolean value that determines whether the elements of the new arrays have the same keys as in the original (useful for associative arrays) or new numeric keys starting from 0 (useful for indexed arrays). The default is to assign new keys, as shown here:&lt;br /&gt;&lt;br /&gt;$nums = range(1, 7);&lt;br /&gt;$rows = array_chunk($nums, 3);&lt;br /&gt;print_r($rows);&lt;br /&gt;Array&lt;br /&gt;(&lt;br /&gt;   [0] =&gt; Array&lt;br /&gt;       (&lt;br /&gt;           [0] =&gt; 1&lt;br /&gt;           [1] =&gt; 2&lt;br /&gt;           [2] =&gt; 3&lt;br /&gt;       )&lt;br /&gt;   [1] =&gt; Array&lt;br /&gt;       (&lt;br /&gt;           [0] =&gt; 4&lt;br /&gt;           [1] =&gt; 5&lt;br /&gt;           [2] =&gt; 6&lt;br /&gt;       )&lt;br /&gt;   [2] =&gt; Array&lt;br /&gt;       (&lt;br /&gt;           [0] =&gt; 7&lt;br /&gt;       )&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Keys and Values&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The array_keys( ) function returns an array consisting of only the keys in the array, in internal order:&lt;br /&gt;&lt;br /&gt;$array_of_keys = array_keys(array);&lt;br /&gt;&lt;br /&gt;Here's an example:&lt;br /&gt;&lt;br /&gt;$person = array('name' =&gt; 'Fred', 'age' =&gt; 35, 'wife' =&gt; 'Wilma');&lt;br /&gt;$keys = array_keys($person);      // $keys is array('name', 'age', 'wife')&lt;br /&gt;&lt;br /&gt;PHP also provides a (less generally useful) function to retrieve an array of just the values in an array, array_values( ):&lt;br /&gt;&lt;br /&gt;$array_of_values = array_values(array);&lt;br /&gt;&lt;br /&gt;As with array_keys( ), the values are returned in the array's internal order:&lt;br /&gt;&lt;br /&gt;$values = array_values($person);       // $values is array('Fred', 35, 'Wilma');&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Checking Whether an Element Exists&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To see if an element exists in the array, use the array_key_exists( ) function:&lt;br /&gt;&lt;br /&gt;if (array_key_exists(key, array)) { ... }&lt;br /&gt;&lt;br /&gt;The function returns a Boolean value that indicates whether the second argument is a valid key in the array given as the first argument.&lt;br /&gt;&lt;br /&gt;It's not sufficient to simply say:&lt;br /&gt;&lt;br /&gt;if ($person['name']) { ... }           // this can be misleading&lt;br /&gt;&lt;br /&gt;Even if there is an element in the array with the key name, its corresponding value might be false (i.e., 0, NULL, or the empty string). Instead, use array_key_exists( ) as follows:&lt;br /&gt;&lt;br /&gt;$person['age'] = 0;                    // unborn?&lt;br /&gt;if ($person['age']) {&lt;br /&gt; echo "true!\n";&lt;br /&gt;}&lt;br /&gt;if (array_key_exists('age', $person)) {&lt;br /&gt; echo "exists!\n";&lt;br /&gt;}&lt;br /&gt;exists!&lt;br /&gt;&lt;br /&gt;In PHP 4.0.6 and earlier versions, the array_key_exists( ) function was called key_exists( ). The original name is still retained as an alias for the new name.&lt;br /&gt;&lt;br /&gt;Many people use the isset( ) function instead, which returns true if the element exists and is not NULL:&lt;br /&gt;&lt;br /&gt;$a = array(0,NULL,'');&lt;br /&gt;function tf($v) { return $v ? "T" : "F"; }&lt;br /&gt;for ($i=0; $i &lt; removed =" array_splice(array," subjects =" array('physics'," removed =" array_splice($subjects," removed =" array_splice($subjects," new =" array('law'," new =" array('law'," subjects =" array('physics'," new =" array('law'," capitals =" array('USA'"&gt; 'Washington',&lt;br /&gt;                 'Great Britain' =&gt; 'London',&lt;br /&gt;                 'New Zealand'   =&gt; 'Wellington',&lt;br /&gt;                 'Australia'     =&gt; 'Canberra',&lt;br /&gt;                 'Italy'         =&gt; 'Rome');&lt;br /&gt;$down_under = array_splice($capitals, 2, 2); // remove New Zealand and Australia&lt;br /&gt;$france = array('France' =&gt; 'Paris');&lt;br /&gt;array_splice($capitals, 1, 0, $france);      // insert France between USA and G.B.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Converting Between Arrays and Variables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;PHP provides two functions, extract( ) and compact( ), that convert between arrays and variables. The names of the variables correspond to keys in the array, and the values of the variables become the values in the array. For instance, this array:&lt;br /&gt;&lt;br /&gt;$person = array('name' =&gt; 'Fred', 'age' =&gt; 35, 'wife' =&gt; 'Betty');&lt;br /&gt;&lt;br /&gt;can be converted to, or built from, these variables:&lt;br /&gt;&lt;br /&gt;$name = 'Fred';&lt;br /&gt;$age  = 35;&lt;br /&gt;$wife = 'Betty';&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Creating Variables from an Array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The extract( ) function automatically creates local variables from an array. The indexes of the array elements are the variable names:&lt;br /&gt;&lt;br /&gt;extract($person);                // $name, $age, and $wife are now set&lt;br /&gt;&lt;br /&gt;If a variable created by the extraction has the same name as an existing one, the extracted variable overwrites the existing variable.&lt;br /&gt;&lt;br /&gt;You can modify extract( )'s behavior by passing a second argument. Appendix A describes the possible values for this second argument. The most useful value is EXTR_PREFIX_SAME, which says that the third argument to extract( ) is a prefix for the variable names that are created. This helps ensure that you create unique variable names when you use extract( ). It is good PHP style to always use EXTR_PREFIX_SAME, as shown here:&lt;br /&gt;&lt;br /&gt;$shape = "round";&lt;br /&gt;$array = array("cover" =&gt; "bird", "shape" =&gt; "rectangular");&lt;br /&gt;extract($array, EXTR_PREFIX_SAME, "book");&lt;br /&gt;echo "Cover: $book_cover, Book Shape: $book_shape, Shape: $shape";&lt;br /&gt;Cover: bird, Book Shape: rectangular, Shape: round&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Creating an Array from Variables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The compact( ) function is the complement of extract( ). Pass it the variable names to compact either as separate parameters or in an array. The compact( ) function creates an associative array whose keys are the variable names and whose values are the variable's values. Any names in the array that do not correspond to actual variables are skipped. Here's an example of compact( ) in action:&lt;br /&gt;&lt;br /&gt;$color = 'indigo';&lt;br /&gt;$shape = 'curvy';&lt;br /&gt;$floppy = 'none';&lt;br /&gt;&lt;br /&gt;$a = compact('color', 'shape', 'floppy');&lt;br /&gt;// or&lt;br /&gt;$names = array('color', 'shape', 'floppy');&lt;br /&gt;$a = compact($names);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Traversing Arrays&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The most common task with arrays is to do something with every element--for instance, sending mail to each element of an array of addresses, updating each file in an array of filenames, or adding up each element of an array of prices. There are several ways to traverse arrays in PHP, and the one you choose will depend on your data and the task you're performing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The foreach Construct&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The most common way to loop over elements of an array is to use the foreach construct:&lt;br /&gt;&lt;br /&gt;$addresses = array('spam@cyberpromo.net', 'abuse@example.com');&lt;br /&gt;foreach ($addresses as $value) {&lt;br /&gt; echo "Processing $value\n";&lt;br /&gt;}&lt;br /&gt;Processing spam@cyberpromo.net&lt;br /&gt;Processing abuse@example.com&lt;br /&gt;&lt;br /&gt;PHP executes the body of the loop (the echo statement) once for each element of $addresses in turn, with $value set to the current element. Elements are processed by their internal order.&lt;br /&gt;&lt;br /&gt;An alternative form of foreach gives you access to the current key:&lt;br /&gt;&lt;br /&gt;$person = array('name' =&gt; 'Fred', 'age' =&gt; 35, 'wife' =&gt; 'Wilma');&lt;br /&gt;foreach ($person as $k =&gt; $v) {&lt;br /&gt; echo "Fred's $k is $v\n";&lt;br /&gt;}&lt;br /&gt;Fred's name is Fred&lt;br /&gt;Fred's age is 35&lt;br /&gt;Fred's wife is Wilma&lt;br /&gt;&lt;br /&gt;In this case, the key for each element is placed in $k and the corresponding value is placed in $v.&lt;br /&gt;&lt;br /&gt;The foreach construct does not operate on the array itself, but rather on a copy of it. You can insert or delete elements in the body of a foreach loop, safe in the knowledge that the loop won't attempt to process the deleted or inserted elements.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The Iterator Functions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Every PHP array keeps track of the current element you're working with; the pointer to the current element is known as the iterator. PHP has functions to set, move, and reset this iterator. The iterator functions are:&lt;br /&gt;&lt;br /&gt;current( )&lt;br /&gt;   Returns the element currently pointed at by the iterator&lt;br /&gt;&lt;br /&gt;reset( )&lt;br /&gt;   Moves the iterator to the first element in the array and returns it&lt;br /&gt;&lt;br /&gt;next( )&lt;br /&gt;   Moves the iterator to the next element in the array and returns it&lt;br /&gt;&lt;br /&gt;prev( )&lt;br /&gt;   Moves the iterator to the previous element in the array and returns it&lt;br /&gt;&lt;br /&gt;end( )&lt;br /&gt;   Moves the iterator to the last element in the array and returns it&lt;br /&gt;&lt;br /&gt;each( )&lt;br /&gt;   Returns the key and value of the current element as an array and moves the iterator to the next element in the array&lt;br /&gt;&lt;br /&gt;key( )&lt;br /&gt;   Returns the key of the current element&lt;br /&gt;&lt;br /&gt;The each( ) function is used to loop over the elements of an array. It processes elements according to their internal order:&lt;br /&gt;&lt;br /&gt;reset($addresses);&lt;br /&gt;while (list($key, $value) = each($addresses)) {&lt;br /&gt; echo "$key is $value&lt;br /&gt;\n";&lt;br /&gt;}&lt;br /&gt;0 is spam@cyberpromo.net&lt;br /&gt;1 is abuse@example.com&lt;br /&gt;&lt;br /&gt;This approach does not make a copy of the array, as foreach does. This is useful for very large arrays when you want to conserve memory.&lt;br /&gt;&lt;br /&gt;The iterator functions are useful when you need to consider some parts of the array separately from others. Example 5-1 shows code that builds a table, treating the first index and value in an associative array as table column headings.&lt;br /&gt;&lt;br /&gt;Example 5-1: Building a table with the iterator functions&lt;br /&gt;&lt;br /&gt;$ages = array('Person'  =&gt; 'Age',&lt;br /&gt;             'Fred'    =&gt; 35,&lt;br /&gt;             'Barney'  =&gt; 30,&lt;br /&gt;             'Tigger'  =&gt; 8,&lt;br /&gt;             'Pooh'    =&gt; 40);&lt;br /&gt;// start table and print heading&lt;br /&gt;reset($ages);&lt;br /&gt;list($c1, $c2) = each($ages);&lt;br /&gt;echo("&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;$c1&lt;/th&gt;&lt;th&gt;$c2&lt;/th&gt;&lt;/tr&gt;\n");&lt;br /&gt;// print the rest of the values&lt;br /&gt;while (list($c1,$c2) = each($ages)) {&lt;br /&gt; echo("&lt;tr&gt;&lt;td&gt;$c1&lt;/td&gt;&lt;td&gt;$c2&lt;/td&gt;&lt;/tr&gt;\n");&lt;br /&gt;}&lt;br /&gt;// end the table&lt;br /&gt;echo("&lt;/tbody&gt;&lt;/table&gt;");&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Person&lt;/th&gt;&lt;th&gt;Age&lt;/th&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Fred&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Barney&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Tigger&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Pooh&lt;/td&gt;&lt;td&gt;40&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Using a for Loop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you know that you are dealing with an indexed array, where the keys are consecutive integers beginning at 0, you can use a for loop to count through the indexes. The for loop operates on the array itself, not on a copy of the array, and processes elements in key order regardless of their internal order.&lt;br /&gt;&lt;br /&gt;Here's how to print an array using for:&lt;br /&gt;&lt;br /&gt;$addresses = array('spam@cyberpromo.net', 'abuse@example.com');&lt;br /&gt;for($i = 0; $i &lt; count($array); $i++) {   $value = $addresses[$i];   echo "$value\n"; } spam@cyberpromo.net abuse@example.com&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;  Calling a Function for Each Array Element &lt;/span&gt;&lt;br /&gt; PHP provides a mechanism, array_walk( ), for calling a user-defined function once per element in an array:  array_walk(array, function_name);  The function you define takes in two or, optionally, three arguments: the first is the element's value, the second is the element's key, and the third is a value supplied to array_walk( ) when it is called. For instance, here's another way to print table columns made of the values from an array:  function print_row($value, $key) {   print("$value$key\n");&lt;br /&gt;}&lt;br /&gt;$person = array('name' =&gt; 'Fred', 'age' =&gt; 35, 'wife' =&gt; 'Wilma');&lt;br /&gt;array_walk($person, 'print_row');&lt;br /&gt;&lt;br /&gt;A variation of this example specifies a background color using the optional third argument to array_walk( ). This parameter gives us the flexibility we need to print many tables, with many background colors:&lt;br /&gt;&lt;br /&gt;function print_row($value, $key, $color) {&lt;br /&gt; print("$value$key\n");&lt;br /&gt;}&lt;br /&gt;$person = array('name' =&gt; 'Fred', 'age' =&gt; 35, 'wife' =&gt; 'Wilma');&lt;br /&gt;array_walk($person, 'print_row', 'blue');&lt;br /&gt;&lt;br /&gt;The array_walk( ) function processes elements in their internal order.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Reducing an Array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A cousin of array_walk( ), array_reduce( ), applies a function to each element of the array in turn, to build a single value:&lt;br /&gt;&lt;br /&gt;$result = array_reduce(array, function_name [, default ]);&lt;br /&gt;&lt;br /&gt;The function takes two arguments: the running total, and the current value being processed. It should return the new running total. For instance, to add up the squares of the values of an array, use:&lt;br /&gt;&lt;br /&gt;function add_up ($running_total, $current_value) {&lt;br /&gt; $running_total += $current_value * $current_value;&lt;br /&gt; return $running_total;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$numbers = array(2, 3, 5, 7);&lt;br /&gt;$total = array_reduce($numbers, 'add_up');&lt;br /&gt;// $total is now 87&lt;br /&gt;&lt;br /&gt;The array_reduce( ) line makes these function calls:&lt;br /&gt;&lt;br /&gt;add_up(2,3)&lt;br /&gt;add_up(13,5)&lt;br /&gt;add_up(38,7)&lt;br /&gt;&lt;br /&gt;The default argument, if provided, is a seed value. For instance, if we change the call to array_reduce( ) in the previous example to:&lt;br /&gt;&lt;br /&gt;$total = array_reduce($numbers, 'add_up', 11);&lt;br /&gt;&lt;br /&gt;The resulting function calls are:&lt;br /&gt;&lt;br /&gt;add_up(11,2)&lt;br /&gt;add_up(13,3)&lt;br /&gt;add_up(16,5)&lt;br /&gt;add_up(21,7)&lt;br /&gt;&lt;br /&gt;If the array is empty, array_reduce( ) returns the default value. If no default value is given and the array is empty, array_reduce( ) returns NULL.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Searching for Values&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The in_array( ) function returns true or false, depending on whether the first argument is an element in the array given as the second argument:&lt;br /&gt;&lt;br /&gt;if (in_array(to_find, array [, strict])) { ... }&lt;br /&gt;&lt;br /&gt;If the optional third argument is true, the types of to_find and the value in the array must match. The default is to not check the types.&lt;br /&gt;&lt;br /&gt;Here's a simple example:&lt;br /&gt;&lt;br /&gt;$addresses = array('spam@cyberpromo.net', 'abuse@example.com',&lt;br /&gt;                  'root@example.com');&lt;br /&gt;$got_spam = in_array('spam@cyberpromo.net', $addresses);   // $got_spam is true&lt;br /&gt;$got_milk = in_array('milk@tucows.com', $addresses);       // $got_milk is false&lt;br /&gt;&lt;br /&gt;PHP automatically indexes the values in arrays, so in_array( ) is much faster than a loop that checks every value to find the one you want.&lt;br /&gt;&lt;br /&gt;Example 5-2 checks whether the user has entered information in all the required fields in a form.&lt;br /&gt;&lt;br /&gt;Example 5-2: Searching an array&lt;br /&gt;&lt;br /&gt;You ';&lt;br /&gt;  echo have_required($_POST, array('name', 'email_address')) ? 'did' : 'did not';&lt;br /&gt;  echo ' have all the required fields.&lt;p&gt;&lt;/p&gt;';&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;form action=""&gt;" method="post"&gt;&lt;br /&gt; &lt;p&gt;&lt;br /&gt;   Name: &lt;input name="name" type="text"&gt;&lt;br /&gt;&lt;br /&gt;   Email address: &lt;input name="email_address" type="text"&gt;&lt;br /&gt;&lt;br /&gt;   Age (optional): &lt;input name="age" type="text"&gt;&lt;br /&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt; &lt;p align="center"&gt;&lt;br /&gt;   &lt;input value="submit" name="submitted" type="submit"&gt;&lt;br /&gt; &lt;/p&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;A variation on in_array( ) is the array_search( ) function. While in_array( ) returns true if the value is found, array_search( ) returns the key of the found element:&lt;br /&gt;&lt;br /&gt;$person = array('name' =&gt; 'Fred', 'age' =&gt; 35, 'wife' =&gt; 'Wilma');&lt;br /&gt;$k = array_search($person, 'Wilma');&lt;br /&gt;echo("Fred's $k is Wilma\n");&lt;br /&gt;Fred's wife is Wilma&lt;br /&gt;&lt;br /&gt;The array_search( ) function also takes the optional third strict argument, which requires the types of the value being searched for and the value in the array to match.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sorting&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sorting changes the internal order of elements in an array and optionally rewrites the keys to reflect this new order. For example, you might use sorting to arrange a list of scores from biggest to smallest, to alphabetize a list of names, or to order a set of users based on how many messages they posted.&lt;br /&gt;&lt;br /&gt;PHP provides three ways to sort arrays--sorting by keys, sorting by values without changing the keys, or sorting by values and then changing the keys. Each kind of sort can be done in ascending order, descending order, or an order defined by a user-defined function.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sorting One Array at a Time&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The functions provided by PHP to sort an array are shown in Table 5-1.&lt;br /&gt;&lt;br /&gt;Table 5-1: PHP functions for sorting an array&lt;br /&gt;&lt;br /&gt;Effect&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Ascending&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Descending&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;User-defined order&lt;br /&gt;&lt;br /&gt;Sort array by values, then reassign indexes starting with 0&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;sort( )&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;rsort( )&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;usort( )&lt;br /&gt;&lt;br /&gt;Sort array by values&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;asort( )&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;arsort( )&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;uasort( )&lt;br /&gt;&lt;br /&gt;Sort array by keys&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;ksort( )&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;krsort( )&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;uksort( )&lt;br /&gt;&lt;br /&gt;The sort( ), rsort( ), and usort( ) functions are designed to work on indexed arrays, because they assign new numeric keys to represent the ordering. They're useful when you need to answer questions like "what are the top 10 scores?" and "who's the third person in alphabetical order?" The other sort functions can be used on indexed arrays, but you'll only be able to access the sorted ordering by using traversal functions such as foreach and next.&lt;br /&gt;&lt;br /&gt;To sort names into ascending alphabetical order, you'd use this:&lt;br /&gt;&lt;br /&gt;$names = array('cath', 'angela', 'brad', 'dave');&lt;br /&gt;sort($names);                // $names is now 'angela', 'brad', 'cath', 'dave'&lt;br /&gt;&lt;br /&gt;To get them in reverse alphabetic order, simply call rsort( ) instead of sort( ).&lt;br /&gt;&lt;br /&gt;If you have an associative array mapping usernames to minutes of login time, you can use arsort( ) to display a table of the top three, as shown here:&lt;br /&gt;&lt;br /&gt;$logins = array('njt' =&gt; 415,&lt;br /&gt;               'kt'  =&gt; 492,&lt;br /&gt;               'rl'  =&gt; 652,&lt;br /&gt;               'jht' =&gt; 441,&lt;br /&gt;               'jj'  =&gt; 441,&lt;br /&gt;               'wt'  =&gt; 402);&lt;br /&gt;arsort($logins);&lt;br /&gt;$num_printed = 0;&lt;br /&gt;echo("&lt;table&gt;\n");&lt;br /&gt;foreach ($logins as $user =&gt; $time ) {&lt;br /&gt; echo("&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;$user&lt;/td&gt;&lt;td&gt;$time&lt;/td&gt;&lt;/tr&gt;\n");&lt;br /&gt; if (++$num_printed == 3) {&lt;br /&gt;   break;                   // stop after three&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;echo("&lt;/tbody&gt;&lt;/table&gt;\n");&lt;br /&gt;&lt;table&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;rl&lt;/td&gt;&lt;td&gt;652&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;kt&lt;/td&gt;&lt;td&gt;492&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;jht&lt;/td&gt;&lt;td&gt;441&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;If you want that table displayed in ascending order by username, use ksort( ):&lt;br /&gt;&lt;br /&gt;ksort($logins);&lt;br /&gt;echo("&lt;table&gt;\n");&lt;br /&gt;foreach ($logins as $user =&gt; $time) {&lt;br /&gt; echo("&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;$user&lt;/td&gt;&lt;td&gt;$time&lt;/td&gt;&lt;/tr&gt;\n");&lt;br /&gt;}&lt;br /&gt;echo("&lt;/tbody&gt;&lt;/table&gt;\n");&lt;br /&gt;&lt;table&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;jht&lt;/td&gt;&lt;td&gt;441&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;jj&lt;/td&gt;&lt;td&gt;441&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;kt&lt;/td&gt;&lt;td&gt;492&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;njt&lt;/td&gt;&lt;td&gt;415&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;rl&lt;/td&gt;&lt;td&gt;652&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;wt&lt;/td&gt;&lt;td&gt;402&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;User-defined ordering requires that you provide a function that takes two values and returns a value that specifies the order of the two values in the sorted array. The function should return 1 if the first value is greater than the second, -1 if the first value is less than the second, and 0 if the values are the same for the purposes of your custom sort order.&lt;br /&gt;&lt;br /&gt;Example 5-3 is a program that lets you try the various sorting functions on the same data.&lt;br /&gt;&lt;br /&gt;Example 5-3: Sorting arrays&lt;br /&gt;&lt;br /&gt;'Buzz Lightyear',&lt;br /&gt;                'email_address' =&gt; 'buzz@starcommand.gal',&lt;br /&gt;                'age' =&gt; 32,&lt;br /&gt;                'smarts' =&gt; 'some');&lt;br /&gt;&lt;br /&gt;if($submitted) {&lt;br /&gt;  if($sort_type == 'usort' || $sort_type == 'uksort' || $sort_type == 'uasort') {&lt;br /&gt;    $sort_type($values, 'user_sort');&lt;br /&gt;  }&lt;br /&gt;  else {&lt;br /&gt;    $sort_type($values);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;form action="index.php"&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;  &lt;input name="sort_type" value="sort" checked="checked" type="radio"&gt;&lt;br /&gt;                                                          Standard sort&lt;br /&gt;&lt;br /&gt;  &lt;input name="sort_type" value="rsort" type="radio"&gt;   Reverse sort&lt;br /&gt;&lt;br /&gt;  &lt;input name="sort_type" value="usort" type="radio"&gt;   User-defined sort&lt;br /&gt;&lt;br /&gt;  &lt;input name="sort_type" value="ksort" type="radio"&gt;   Key sort&lt;br /&gt;&lt;br /&gt;  &lt;input name="sort_type" value="krsort" type="radio"&gt;  Reverse key sort&lt;br /&gt;&lt;br /&gt;  &lt;input name="sort_type" value="uksort" type="radio"&gt;  User-defined key sort&lt;br /&gt;&lt;br /&gt;  &lt;input name="sort_type" value="asort" type="radio"&gt;  Value sort&lt;br /&gt;&lt;br /&gt;  &lt;input name="sort_type" value="arsort" type="radio"&gt; Reverse value sort&lt;br /&gt;&lt;br /&gt;  &lt;input name="sort_type" value="uasort" type="radio"&gt; User-defined value sort&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;br /&gt;   &lt;input value="Sort" name="submitted" type="submit"&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;   Values :&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  $value) {&lt;br /&gt;     echo "&lt;li&gt;&lt;b&gt;$key&lt;/b&gt;: $value&lt;/li&gt;";&lt;br /&gt;   }&lt;br /&gt;  ?&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Natural-Order Sorting&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;PHP's built-in sort functions correctly sort strings and numbers, but they don't correctly sort strings that contain numbers. For example, if you have the filenames ex10.php, ex5.php, and ex1.php, the normal sort functions will rearrange them in this order: ex1.php, ex10.php, ex5.php. To correctly sort strings that contain numbers, use the natsort( ) and natcasesort( ) functions:&lt;br /&gt;&lt;br /&gt;$output = natsort(input);&lt;br /&gt;$output = natcasesort(input);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sorting Multiple Arrays at Once&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The array_multisort( ) function sorts multiple indexed arrays at once:&lt;br /&gt;&lt;br /&gt;array_multisort(array1 [, array2, ... ]);&lt;br /&gt;&lt;br /&gt;Pass it a series of arrays and sorting orders (identified by the SORT_ASC or SORT_DESC constants), and it reorders the elements of all the arrays, assigning new indexes. It is similar to a join operation on a relational database.&lt;br /&gt;&lt;br /&gt;Imagine that you have a lot of people, and several pieces of data on each person:&lt;br /&gt;&lt;br /&gt;$names = array('Tom', 'Dick',  'Harriet', 'Brenda', 'Joe');&lt;br /&gt;$ages  = array(25,    35,      29,        35,       35);&lt;br /&gt;$zips  = array(80522, '02140', 90210,     64141,    80522);&lt;br /&gt;&lt;br /&gt;The first element of each array represents a single record--all the information known about Tom. Similarly, the second element constitutes another record--all the information known about Dick. The array_multisort( ) function reorders the elements of the arrays, preserving the records. That is, if Dick ends up first in the $names array after the sort, the rest of Dick's information will be first in the other arrays too. (Note that we needed to quote Dick's zip code to prevent it from being interpreted as an octal constant.)&lt;br /&gt;&lt;br /&gt;Here's how to sort the records first ascending by age, then descending by zip code:&lt;br /&gt;&lt;br /&gt;array_multisort($ages, SORT_ASC, $zips, SORT_DESC, $names, SORT_ASC);&lt;br /&gt;&lt;br /&gt;We need to include $names in the function call to ensure that Dick's name stays with his age and zip code. Printing out the data shows the result of the sort:&lt;br /&gt;&lt;br /&gt;echo("&lt;table&gt;\n");&lt;br /&gt;for ($i=0; $i &lt;&gt;&lt;tr&gt;&lt;td&gt;$ages[$i]&lt;/td&gt;&lt;td&gt;$zips[$i]&lt;/td&gt;&lt;td&gt;$names[$i]&lt;/td&gt;\n");&lt;br /&gt;}&lt;br /&gt;echo("&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;\n");&lt;br /&gt;&lt;table&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;80522&lt;/td&gt;&lt;td&gt;Tom&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;29&lt;/td&gt;&lt;td&gt;90210&lt;/td&gt;&lt;td&gt;Harriet&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;80522&lt;/td&gt;&lt;td&gt;Joe&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;64141&lt;/td&gt;&lt;td&gt;Brenda&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;02140&lt;/td&gt;&lt;td&gt;Dick&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Reversing Arrays&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The array_reverse( ) function reverses the internal order of elements in an array:&lt;br /&gt;&lt;br /&gt;$reversed = array_reverse(array);&lt;br /&gt;&lt;br /&gt;Numeric keys are renumbered starting at 0, while string indexes are unaffected. In general, it's better to use the reverse-order sorting functions instead of sorting and then reversing the order of an array.&lt;br /&gt;&lt;br /&gt;The array_flip( ) function returns an array that reverses the order of each original element's key-value pair:&lt;br /&gt;&lt;br /&gt;$flipped = array_flip(array);&lt;br /&gt;&lt;br /&gt;That is, for each element of the array whose value is a valid key, the element's value becomes its key and the element's key becomes its value. For example, if you have an array mapping usernames to home directories, you can use array_flip( ) to create an array mapping home directories to usernames:&lt;br /&gt;&lt;br /&gt;$u2h = array('gnat' =&gt; '/home/staff/nathan',&lt;br /&gt;            'rasmus' =&gt; '/home/elite/rasmus',&lt;br /&gt;            'ktatroe' =&gt; '/home/staff/kevin');&lt;br /&gt;$h2u = array_flip($u2h);&lt;br /&gt;$user = $h2u['/home/staff/kevin'];     // $user is now 'ktatroe'&lt;br /&gt;&lt;br /&gt;Elements whose original values are neither strings nor integers are left alone in the resulting array. The new array lets you discover the key in the original array given its value, but this technique works effectively only when the original array has unique values.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Randomizing Order&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To traverse the elements in an array in a random order, use the shuffle( ) function. All existing keys, whether string or numeric, are replaced with consecutive integers starting at 0.&lt;br /&gt;&lt;br /&gt;Here's how to randomize the order of the days of the week:&lt;br /&gt;&lt;br /&gt;$days = array('Monday', 'Tuesday', 'Wednesday',&lt;br /&gt; 'Thursday', 'Friday', 'Saturday', 'Sunday');&lt;br /&gt;shuffle($days);&lt;br /&gt;print_r($days);&lt;br /&gt;Array&lt;br /&gt;(&lt;br /&gt;   [0] =&gt; Tuesday&lt;br /&gt;   [1] =&gt; Thursday&lt;br /&gt;   [2] =&gt; Monday&lt;br /&gt;   [3] =&gt; Friday&lt;br /&gt;   [4] =&gt; Wednesday&lt;br /&gt;   [5] =&gt; Saturday&lt;br /&gt;   [6] =&gt; Sunday&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;Obviously, the order after your shuffle( ) may not be the same as the sample output here. Unless you are interested in getting multiple random elements from an array, without repeating any specific item, using the rand( ) function to pick an index is more efficient.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Acting on Entire Arrays&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;PHP has several useful functions for modifying or applying an operation to all elements of an array. You can merge arrays, find the difference, calculate the total, and more, all using built-in functions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Calculating the Sum of an Array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The array_sum( ) function adds up the values in an indexed or associative array:&lt;br /&gt;&lt;br /&gt;$sum = array_sum(array);&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;$scores  = array(98, 76, 56, 80);&lt;br /&gt;$total   = array_sum($scores);&lt;br /&gt;// $total = 310&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Merging Two Arrays&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The array_merge( ) function intelligently merges two or more arrays:&lt;br /&gt;&lt;br /&gt;$merged = array_merge(array1, array2 [, array ... ])&lt;br /&gt;&lt;br /&gt;If a numeric key from an earlier array is repeated, the value from the later array is assigned a new numeric key:&lt;br /&gt;&lt;br /&gt;$first  = array('hello', 'world');      // 0 =&gt; 'hello', 1 =&gt; 'world'&lt;br /&gt;$second = array('exit',  'here');       // 0 =&gt; 'exit',  1 =&gt; 'here'&lt;br /&gt;$merged = array_merge($first, $second);&lt;br /&gt;// $merged = array('hello', 'world', 'exit', 'here')&lt;br /&gt;&lt;br /&gt;If a string key from an earlier array is repeated, the earlier value is replaced by the later value:&lt;br /&gt;&lt;br /&gt;$first  = array('bill' =&gt; 'clinton', 'tony' =&gt; 'danza');&lt;br /&gt;$second = array('bill' =&gt; 'gates',   'adam' =&gt; 'west');&lt;br /&gt;$merged = array_merge($first, $second);&lt;br /&gt;// $merged = array('bill' =&gt; 'gates', 'tony' =&gt; 'danza', 'adam' =&gt; 'west')&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Calculating the Difference Between Two Arrays&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The array_diff( ) function identifies values from one array that are not present in others:&lt;br /&gt;&lt;br /&gt;$diff = array_diff(array1, array2 [, array ... ]);&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;$a1 = array('bill', 'claire', 'elle', 'simon', 'judy');&lt;br /&gt;$a2 = array('jack', 'claire', 'toni');&lt;br /&gt;$a3 = array('elle', 'simon',  'garfunkel');&lt;br /&gt;// find values of $a1 not in $a2 or $a3&lt;br /&gt;$diff = array_diff($a1, $a2, $a3);&lt;br /&gt;// $diff is array('bill', 'judy');&lt;br /&gt;&lt;br /&gt;Values are compared using ===, so 1 and "1" are considered different. The keys of the first array are preserved, so in $diff the key of 'bill' is 0 and the key of 'judy' is 4.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Filtering Elements from an Array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To identify a subset of an array based on its values, use the array_filter( ) function:&lt;br /&gt;&lt;br /&gt;$filtered = array_filter(array, callback);&lt;br /&gt;&lt;br /&gt;Each value of array is passed to the function named in callback. The returned array contains only those elements of the original array for which the function returns a true value. For example:&lt;br /&gt;&lt;br /&gt;function is_odd ($element) {&lt;br /&gt; return $element % 2;&lt;br /&gt;}&lt;br /&gt;$numbers = array(9, 23, 24, 27);&lt;br /&gt;$odds    = array_filter($numbers, 'is_odd');&lt;br /&gt;// $odds is array(0 =&gt; 9, 1 =&gt; 23, 3 =&gt; 27)&lt;br /&gt;&lt;br /&gt;As you see, the keys are preserved. This function is most useful with associative arrays.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Using Arrays&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Arrays crop up in almost every PHP program. In addition to their obvious use for storing collections of values, they're also used to implement various abstract data types. In this section, we show how to use arrays to implement sets and stacks.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sets&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Arrays let you implement the basic operations of set theory: union, intersection, and difference. Each set is represented by an array, and various PHP functions implement the set operations. The values in the set are the values in the array--the keys are not used, but they are generally preserved by the operations.&lt;br /&gt;&lt;br /&gt;The union of two sets is all the elements from both sets, with duplicates removed. The array_merge( ) and array_unique( ) functions let you calculate the union. Here's how to find the union of two arrays:&lt;br /&gt;&lt;br /&gt;function array_union($a, $b) {&lt;br /&gt; $union = array_merge($a, $b); // duplicates may still exist&lt;br /&gt; $union = array_unique($union);&lt;br /&gt;&lt;br /&gt; return $union;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$first = array(1, 'two', 3);&lt;br /&gt;$second = array('two', 'three', 'four');&lt;br /&gt;$union = array_union($first, $second);&lt;br /&gt;print_r($union);&lt;br /&gt;Array&lt;br /&gt;(&lt;br /&gt;   [0] =&gt; 1&lt;br /&gt;   [1] =&gt; two&lt;br /&gt;   [2] =&gt; 3&lt;br /&gt;   [4] =&gt; three&lt;br /&gt;   [5] =&gt; four&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;The intersection of two sets is the set of elements they have in common. PHP's built-in array_intersect( ) function takes any number of arrays as arguments and returns an array of those values that exist in each. If multiple keys have the same value, the first key with that value is preserved.&lt;br /&gt;&lt;br /&gt;Another common function to perform on a set of arrays is to get the difference; that is, the values in one array that are not present in another array. The array_diff( ) function calculates this, returning an array with values from the first array that are not present in the second.&lt;br /&gt;&lt;br /&gt;The following code takes the difference of two arrays:&lt;br /&gt;&lt;br /&gt;$first = array(1, 'two', 3);&lt;br /&gt;$second = array('two', 'three', 'four');&lt;br /&gt;$difference = array_diff($first, $second);&lt;br /&gt;print_r($difference);&lt;br /&gt;Array&lt;br /&gt;(&lt;br /&gt;   [0] =&gt; 1&lt;br /&gt;   [2] =&gt; 3&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Stacks&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Although not as common in PHP programs as in other programs, one fairly common data type is the last-in first-out (LIFO) stack. We can create stacks using a pair of PHP functions, array_push( ) and array_pop( ). The array_push( ) function is identical to an assignment to $array[]. We use array_push( ) because it accentuates the fact that we're working with stacks, and the parallelism with array_pop() makes our code easier to read. There are also array_shift( ) and array_unshift( ) functions for treating an array like a queue.&lt;br /&gt;&lt;br /&gt;Stacks are particularly useful for maintaining state. Example 5-4 provides a simple state debugger that allows you to print out a list of which functions have been called up to this point (i.e., the stack trace).&lt;br /&gt;&lt;br /&gt;Example 5-4: State debugger&lt;br /&gt;&lt;br /&gt;$call_trace = array(  );&lt;br /&gt;&lt;br /&gt;function enter_function($name) {&lt;br /&gt; global $call_trace;&lt;br /&gt; array_push($call_trace, $name); // same as $call_trace[] = $name&lt;br /&gt;&lt;br /&gt; echo "Entering $name (stack is now: " . join(' -&gt; ', $call_trace) . ')&lt;br /&gt;';&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function exit_function(  ) {&lt;br /&gt; echo 'Exiting&lt;br /&gt;';&lt;br /&gt;&lt;br /&gt; global $call_trace;&lt;br /&gt; array_pop($call_trace);        // we ignore array_pop(  )'s return value&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function first(  ) {&lt;br /&gt; enter_function('first');&lt;br /&gt; exit_function(  );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function second(  ) {&lt;br /&gt; enter_function('second');&lt;br /&gt;   first(  );&lt;br /&gt; exit_function(  );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function third(  ) {&lt;br /&gt; enter_function('third');&lt;br /&gt;   second(  );&lt;br /&gt;   first(  );&lt;br /&gt; exit_function(  );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;first(  );&lt;br /&gt;third(  );&lt;br /&gt;&lt;br /&gt;Here's the output from Example 5-4:&lt;br /&gt;&lt;br /&gt;Entering first (stack is now: first)&lt;br /&gt;Exiting&lt;br /&gt;Entering third (stack is now: third)&lt;br /&gt;Entering second (stack is now: third -&gt; second)&lt;br /&gt;Entering first (stack is now: third -&gt; second -&gt; first)&lt;br /&gt;Exiting&lt;br /&gt;Exiting&lt;br /&gt;Entering first (stack is now: third -&gt; first)&lt;br /&gt;Exiting&lt;br /&gt;Exiting&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-7954917454130087848?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/7954917454130087848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/arrays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7954917454130087848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7954917454130087848'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/arrays.html' title='Arrays'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-2455963447470547474</id><published>2009-02-04T22:14:00.000-08:00</published><updated>2009-02-04T22:16:50.611-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP Looping'/><title type='text'>PHP Looping</title><content type='html'>Very often when you write code, you want the same block of code to run a number of times. You can use looping statements in your code to perform this.&lt;br /&gt;&lt;br /&gt;In PHP we have the following looping statements:&lt;br /&gt;&lt;br /&gt;    * while - loops through a block of code if and as long as a specified condition is true&lt;br /&gt;    * do...while - loops through a block of code once, and then repeats the loop as long as a special condition is true&lt;br /&gt;    * for - loops through a block of code a specified number of times&lt;br /&gt;    * foreach - loops through a block of code for each element in an array&lt;br /&gt;&lt;br /&gt;The while Statement&lt;br /&gt;&lt;br /&gt;The while statement will execute a block of code if and as long as a condition is true.&lt;br /&gt;Syntax&lt;br /&gt;&lt;br /&gt;while (condition)&lt;br /&gt;code to be executed;&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;br /&gt;The following example demonstrates a loop that will continue to run as long as the variable i is less than, or equal to 5. i will increase by 1 each time the loop runs:&lt;br /&gt;&lt;br /&gt;&lt; html&gt;&lt;br /&gt;&lt; body&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php &lt;br /&gt;$i=1;&lt;br /&gt;while($i&lt;=5)&lt;br /&gt;  {&lt;br /&gt;  echo "The number is " . $i . "&lt;br /&gt;";&lt;br /&gt;  $i++;&lt;br /&gt;  }&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt; /body&gt;&lt;br /&gt;&lt; /html&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The do...while Statement&lt;br /&gt;&lt;br /&gt;The do...while statement will execute a block of code at least once - it then will repeat the loop as long as a condition is true.&lt;br /&gt;Syntax&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;code to be executed;&lt;br /&gt;}&lt;br /&gt;while (condition);&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;br /&gt;The following example will increment the value of i at least once, and it will continue incrementing the variable i as long as it has a value of less than 5:&lt;br /&gt;&lt;br /&gt;&lt; html&gt;&lt;br /&gt;&lt; body&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php &lt;br /&gt;$i=0;&lt;br /&gt;do&lt;br /&gt;  {&lt;br /&gt;  $i++;&lt;br /&gt;  echo "The number is " . $i . "&lt;br /&gt;";&lt;br /&gt;  }&lt;br /&gt;while ($i&lt;5);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt; /body&gt;&lt;br /&gt;&lt; /html&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The for Statement&lt;br /&gt;&lt;br /&gt;The for statement is the most advanced of the loops in PHP.&lt;br /&gt;&lt;br /&gt;In it's simplest form, the for statement is used when you know how many times you want to execute a statement or a list of statements.&lt;br /&gt;Syntax&lt;br /&gt;&lt;br /&gt;for (init; cond; incr)&lt;br /&gt;{&lt;br /&gt;  code to be executed;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Parameters:&lt;br /&gt;&lt;br /&gt;    * init: Is mostly used to set a counter, but can be any code to be executed once at the beginning of the loop statement.&lt;br /&gt;    * cond: Is evaluated at beginning of each loop iteration. If the condition evaluates to TRUE, the loop continues and the code executes. If it evaluates to FALSE, the execution of the loop ends.&lt;br /&gt;    * incr: Is mostly used to increment a counter, but can be any code to be executed at the end of each loop.&lt;br /&gt;&lt;br /&gt;Note: Each of the parameters can be empty or have multiple expressions separated by commas.&lt;br /&gt;&lt;br /&gt;    * cond: All expressions separated by a comma are evaluated but the result is taken from the last part. This parameter being empty means the loop should be run indefinitely. This is useful when using a conditional break statement inside the loop for ending the loop.&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;br /&gt;The following example prints the text "Hello World!" five times:&lt;br /&gt;&lt;br /&gt;&lt; html&gt;&lt;br /&gt;&lt; body&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;for ($i=1; $i&lt;=5; $i++)&lt;br /&gt;{&lt;br /&gt;  echo "Hello World!&lt;br /&gt;";&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt; /body&gt;&lt;br /&gt;&lt; /html&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The foreach Statement&lt;br /&gt;&lt;br /&gt;The foreach statement is used to loop through arrays.&lt;br /&gt;&lt;br /&gt;For every loop, the value of the current array element is assigned to $value (and the array pointer is moved by one) - so on the next loop, you'll be looking at the next element.&lt;br /&gt;Syntax&lt;br /&gt;&lt;br /&gt;foreach (array as value)&lt;br /&gt;{&lt;br /&gt;    code to be executed;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;br /&gt;The following example demonstrates a loop that will print the values of the given array:&lt;br /&gt;&lt;br /&gt;&lt; html&gt;&lt;br /&gt;&lt; body&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$arr=array("one", "two", "three");&lt;br /&gt;&lt;br /&gt;foreach ($arr as $value)&lt;br /&gt;{&lt;br /&gt;  echo "Value: " . $value . "&lt;br /&gt;";&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt; /body&gt;&lt;br /&gt;&lt; /html&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-2455963447470547474?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/2455963447470547474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/php-looping.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2455963447470547474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2455963447470547474'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/02/php-looping.html' title='PHP Looping'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-5480081264632188420</id><published>2009-01-31T23:04:00.000-08:00</published><updated>2009-01-31T23:11:29.485-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Email with PHP'/><title type='text'>Email with PHP</title><content type='html'>One of the most common tasks that a PHP programmer has to tackle is the development of applications that send MIME email in one form or another. In simple terms, MIME email consists of an extension of traditional email technology and comes in handy for sending email messages in fancy HTML and handling file attachments in a wide variety of formats. This article is the first part of a five-part series.&lt;br /&gt;&lt;br /&gt;While using MIME email with PHP is a pretty fun process, the bad news is that it can be quite challenging to implement, particularly if you're not very familiar with its most complex facets. There's also the possibility that you often find yourself writing the same annoying code over and over again, especially when you have to construct MIME email modules within your applications.&lt;br /&gt;&lt;br /&gt;In either case, one thing is certain: creating MIME email-related scripts with PHP is one of those things that you'll only want to do once in your lifetime. Suppose you're sick of writing code used to send MIME email to your customers and wish to find a more practical solution to this task. Well, you could pick up one of the numerous third-party classes that are available on the web, or develop your own fine-tuned MIME email class that can be reused many times in the future.&lt;br /&gt;&lt;br /&gt;If you have any interest in the last option, then you'll find this article series pretty useful. In the different tutorials that comprise it, I'll teach you how to build a modular MIME mailer class with PHP 5. It will be equipped with a bunch of intuitive methods that are useful for handling the most common tasks associated with sending MIME email.&lt;br /&gt;&lt;br /&gt;In this first part of the series, I'll walk you through creating the bare bones structure of the mailer class, and I'll be progressively adding more to it in upcoming articles.&lt;br /&gt;&lt;br /&gt;Now, let's move forward and learn how to build a reusable MIME mailer class with PHP. Here we go!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-5480081264632188420?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/5480081264632188420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/email-with-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/5480081264632188420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/5480081264632188420'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/email-with-php.html' title='Email with PHP'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-3387982827444925180</id><published>2009-01-31T22:41:00.000-08:00</published><updated>2009-01-31T23:04:13.794-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php with forms'/><title type='text'>php with forms</title><content type='html'>PHP forms with examples&lt;br /&gt;&lt;br /&gt;PHP is one of the most popular means of processing HTML forms. This website will show you how to process PHP form and send form results to your e-mail address.&lt;br /&gt;&lt;br /&gt;» Process PHP forms the secure way!&lt;br /&gt;&lt;br /&gt;This tutorial has emphasis on processing PHP forms with security in mind! There are too many tutorials out there that rely on PHP's notorious register_globals setting activated with very little or no form input validating. Proper validation of form input data is the most important step in protecting your form from hackers and spammers!&lt;br /&gt;&lt;br /&gt;This php form tutorial is sponsored by GWdish.com Dish Network&lt;br /&gt;&lt;br /&gt;» Is this tutorial for me?&lt;br /&gt;&lt;br /&gt;If you have at least basic understanding of HTML and PHP you shouldn't have any problems with this tutorial. You will not learn HTML here and this is also not a complete PHP tutorial, but rather a tutorial on working with HTML forms in PHP.&lt;br /&gt;&lt;br /&gt;» PHP forms tutorial&lt;br /&gt;&lt;br /&gt;The first part of this website is a tutorial about handling HTML forms with PHP. We recommend starting with the first lesson and reading through others. Each ensuing lesson will assume you already have knowledge from the previous one. Also the same code is used and upgraded throughout the tutorial.&lt;br /&gt;  1.1  PHP forms tutorial &lt;- START HERE&lt;br /&gt;  1.2  Validating forms with PHP&lt;br /&gt;  1.3  Required and optional fields&lt;br /&gt;  1.4  Validating URL and E-mail&lt;br /&gt;  1.5  Form to mail&lt;br /&gt;  1.6  Putting it all together&lt;br /&gt;  1.7  Final words and further reading&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;» PHP forms "How to"&lt;br /&gt;&lt;br /&gt;The "How to" section consists of articles and code examples covering some specific issues, requirements and features of PHP forms.&lt;br /&gt;&lt;br /&gt;If you are not familiar with PHP and handling HTML forms we recommend that you start with the above tutorial first before reading these articles.&lt;br /&gt;  2.1  PHP form not working&lt;br /&gt;  2.2  Sending form results to multiple recipients&lt;br /&gt;  2.3  Sending an autoresponder message&lt;br /&gt;  2.4  Make sure form e-mails are not blocked by your SPAM filter&lt;br /&gt;  2.5  Stop form SPAM without using Captcha&lt;br /&gt;  2.6  Which method to use for your form: GET or POST?&lt;br /&gt;  2.7  Contact forms or Help desk software?&lt;br /&gt;  2.8  Prevent multiple form submissions&lt;span style="font-weight:bold;"&gt;&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-3387982827444925180?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/3387982827444925180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/php-with-forms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3387982827444925180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/3387982827444925180'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/php-with-forms.html' title='php with forms'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-4598775452682493049</id><published>2009-01-31T22:30:00.002-08:00</published><updated>2009-01-31T22:41:34.890-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Form to Mail Script'/><title type='text'>Form to Mail Script</title><content type='html'>This PHP script will generate nicely formatted emails based on fields posted to the script from a form. The script is a lot more advanced than most of the PHP mail scripts that I have seen elsewhere on the web. This script can handle any formatting associated with emails with both HTML and plain text. It also handles attachments as well as embedding images directly into the HTML emails. The following information tells you how to check that the script will run on your server, how to configure it, and what it can do.&lt;br /&gt;Will it run on my server?&lt;br /&gt;&lt;br /&gt;To be able to use this script you should first Check the Server to ensure that your host supports PHP. Next, try creating a php page containing the following text and see if you receive an email when you run the page (substitute your email address for you@your.email). If the email arrives (with subject of "test message" and content of "This is a test") then the script will work on your server.&lt;br /&gt;&lt;? mail("you@your.email","test message","This is a test"); ?&gt;&lt;br /&gt;Configuration&lt;br /&gt;&lt;br /&gt;Configuring the form to mail script need be done only once when you first install it on your site.&lt;br /&gt;Calling the script&lt;br /&gt;&lt;br /&gt;Attaching the form to mail script to a form on your web page is relatively straightforward. You just need to be aware of those form fields that have a special meaning to the script.&lt;br /&gt;&lt;br /&gt;If you want to see for yourself something of what can be done with this form to email script please enter your email address into the following form and send yourself a sample email using the script. The free version of the script is attached to the email and a link to the advanced version of the script is also included.&lt;br /&gt;Examples&lt;br /&gt;&lt;br /&gt;There are a number of examples of how to use this form to mail script which demonstrate how it can be used to create a variety of different types of emails from simple plain text ones to combinations of text and HTML with attachments and embedded images.&lt;br /&gt;How to obtain the script&lt;br /&gt;&lt;br /&gt;Unfortunately, I have to try to fund the running of this web site somehow and so I have decided to charge a nominal amount for server side scripts such as the more advanced version of this one. You can download the simpler version at no charge but you will be missing out on all of the advanced formatting functions as well as html, attachment and embedded image support.&lt;br /&gt;&lt;br /&gt;Use the following form to purchase the Advanced version of the Felgall Form to eMail PHP script that can handle all of the customizations described above for just $10.80 USD (Australian residents price is $17.00 AUD including GST). All purchases include 12 months free support including all updates to the script released during that time. If you have a valid discount code then enter it to purchase this script at an even lower price otherwise just leave the discount field blank, select the currency to make your payment and then press the buy now button. The script will be automatically emailed to you as soon as Paypal verifies your payment.&lt;br /&gt;&lt;br /&gt;Before you purchase this script you should reread the above information to ensure that the script will work on your server. You can also test that the free version of the script will work on your server before purchasing the advanced version. As much of the code is common between the two versions you can be sure that the advanced version that you purchase will work correctly if the free version does. If you cancel at any point during the payment process, you will be returned to this page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-4598775452682493049?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/4598775452682493049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/form-to-mail-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4598775452682493049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/4598775452682493049'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/form-to-mail-script.html' title='Form to Mail Script'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-1684944940386337402</id><published>2009-01-31T22:30:00.001-08:00</published><updated>2009-01-31T22:30:43.181-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Final notes'/><title type='text'>Final notes</title><content type='html'>You should take into account that the configuration of your test server may differ from your web host configuration. Although most of the pages/scripts will run in the same way, some things can behave different or won't work at all.&lt;br /&gt;&lt;br /&gt;For Apache, this problem is mainly an issue of having a different set of active modules than in your web host, and of course, this can be solved activating or deactivating that modules. Besides this, the configuration options of httpd.conf are mostly related to security and technical issues (like supporting subdomains, adding virtual folders...). Usually, the configuration relative to pages (URL rewriting, redirects...) is stored in .htaccess files.&lt;br /&gt;&lt;br /&gt;For PHP the differences in the configuration are more relevant since they can modify how some scripts works (like the already mentioned register_globals option). The configuration set by the PHP installer includes the set of options recommended by PHP.net, which is used by most servers, but the final configuration is in the hands of the server administrator.&lt;br /&gt;&lt;br /&gt;For example, an usual configuration change for production environments is suppressing the display of error messages that aren't critical, and thus limiting the information available to possible attackers. Although this change doesn't affect the behaviour of the scripts, you can be greeted with a lot of "E_NOTICE" errors the first time you run your scripts in your test server.&lt;br /&gt;&lt;br /&gt;An related to MySQL, the main difference probably would be that in the test server you have full administrator rights while in your web host you won't have some of that rights. This shouldn't affect scripts, since in a properly configured server you should have all the rights needed for quering and managing your databases, and you can create an user with the same limitations of the one you have in your web server. Another difference is that you will have a different user &amp; password in your web host, but you can replicate it in the test server.&lt;br /&gt;&lt;br /&gt;Anyway, having a test server in your computer can speed up the development on your pages and scripts, and allows developing and testing server scripts even when you don't have an Internet connection available.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-1684944940386337402?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/1684944940386337402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/final-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1684944940386337402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1684944940386337402'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/final-notes.html' title='Final notes'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-8445702815672447570</id><published>2009-01-31T22:15:00.000-08:00</published><updated>2009-01-31T22:16:02.140-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP Functions and keywords'/><title type='text'>PHP Functions and keywords</title><content type='html'>associative array An array that uses text indexes; an associative array would be used as follows: $arrSomeArray[‘elementName’]&lt;br /&gt;&lt;br /&gt;client-side scripting Script code that runs on the client machine (as opposed to the server machine). A common example of this is JavaScript code, which is executed by a user’s browser.&lt;br /&gt;&lt;br /&gt;server-side scripting Scripting that is executed on the server before anything is sent to the client.&lt;br /&gt;&lt;br /&gt;constructor A function that is called automatically upon a new instantiation of a class.&lt;br /&gt;&lt;br /&gt;cookie A small piece of information that can be stored on a client machine by a program on the server if the browser allows it.&lt;br /&gt;&lt;br /&gt;database A collection of data held in a specific place and usually accessed through a database server, such as MySQL.&lt;br /&gt;&lt;br /&gt;global The main scope in a PHP script; all variables not contained in functions and classes.&lt;br /&gt;&lt;br /&gt;here-doc A string-quoting style that allows for clearly readable multiline strings; most closely related to doubled quoting in PHP.&lt;br /&gt;&lt;br /&gt;HTTP The protocol used by Web servers and browsers to request and transfer files.&lt;br /&gt;&lt;br /&gt;inheritance The automatic gaining of a parent class’s member variables and functions.&lt;br /&gt;&lt;br /&gt;JavaScript A scripting language unrelated to Java (with the exception of a few syntactical and structural similarities); almost always executed client-side.&lt;br /&gt;&lt;br /&gt;object-oriented programming language A programming language, such as C++, Java, or PHP, that makes use of abstract data types (classes).&lt;br /&gt;&lt;br /&gt;Object-Oriented Programming (OOP) Programming in an OO (objectoriented) language, which enables the programmer to model real-world concepts with classes and thus break problems down into smaller, independent or interdependent parts.&lt;br /&gt;&lt;br /&gt;open source software Software to which the source code is freely available.&lt;br /&gt;&lt;br /&gt;pattern matching The act of matching a regular expression against a string.&lt;br /&gt;&lt;br /&gt;parent class The class from which a subclass was derived.&lt;br /&gt;&lt;br /&gt;recursion The calling of a function from itself. The result is similar to a loop, but less efficient and generally more confusing.&lt;br /&gt;&lt;br /&gt;reference An alias to a variable.&lt;br /&gt;&lt;br /&gt;row A single record or entry in a MySQL table.&lt;br /&gt;&lt;br /&gt;column A set of all the same fields from every row in a table.&lt;br /&gt;&lt;br /&gt;regular expression A collection of special wildcard characters used to search strings for only partially known string patterns.&lt;br /&gt;&lt;br /&gt;string A collection of one or more letters; a string can be a word, a sentence, or just a single letter.&lt;br /&gt;&lt;br /&gt;subclass A class created by extending a parent class using the extends keyword.&lt;br /&gt;&lt;br /&gt;type casting The act of forcing a variable to become a given type.&lt;br /&gt;&lt;br /&gt;true The opposite of false. Can also be represented by any non-zero number, non-null value, or non-empty string.&lt;br /&gt;&lt;br /&gt;unary operator An operator that only takes one argument. Example: the negative sign in –21 is a unary operator.&lt;br /&gt;&lt;br /&gt;whitespace Any character that doesn’t print a visible character on the screen; whitespace characters include new lines (\n), spaces, tabs, and so on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-8445702815672447570?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/8445702815672447570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/php-functions-and-keywords.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8445702815672447570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8445702815672447570'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/php-functions-and-keywords.html' title='PHP Functions and keywords'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-1325509731982364888</id><published>2009-01-31T22:13:00.000-08:00</published><updated>2009-01-31T22:15:09.061-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Array Functions:'/><title type='text'>Array Functions:</title><content type='html'>array&lt;br /&gt;Creates a new array. &lt;br /&gt;Format: $array = array(key=&gt;value, key=&gt;value, key=&gt;value,...);&lt;br /&gt;array_count_values&lt;br /&gt;Creates an array that contains a count of the values in the original array.&lt;br /&gt;Format: $array_out = array_count_values($orig_array);&lt;br /&gt;For example, suppose that $orig_array contained the following:&lt;br /&gt;$orig_array[a] = John&lt;br /&gt;$orig_array[b] = Mary&lt;br /&gt;$orig_array[c] = John&lt;br /&gt;$orig-Array[d] = Jose&lt;br /&gt;Then $array_out would contain the following:&lt;br /&gt;$array[John] = 2&lt;br /&gt;$array[Mary} = 1&lt;br /&gt;$array[Jose] = 1&lt;br /&gt;&lt;br /&gt;array_diff&lt;br /&gt;Returns $array_out with elements from $array1 that are not present in any other of the specified arrays ($array2, $array3, and so on). &lt;br /&gt;Format: $array_out = array_diff($array1,$array2,$array3 . . .);&lt;br /&gt;array_intersect&lt;br /&gt;Creates an array that contains the elements that are the same (rather than different) in two or more arrays. Format: $simArray = array_intersect($array1,$array2, . . .);&lt;br /&gt;array_keys&lt;br /&gt;Creates an array containing all the keys in the $orig_array. If search_key is included, only keys that match search_key are in the new array.&lt;br /&gt;Format: $array_out = array_keys($orig_array,”search_key”);&lt;br /&gt;For example, suppose that $orig_array contained the following:&lt;br /&gt;$orig_array[a] = CA&lt;br /&gt;$orig_array[b] = OR&lt;br /&gt;$orig_array[c] = TX&lt;br /&gt;Then $array_out would contain the following:&lt;br /&gt;$array_out[0] = a&lt;br /&gt;$array_out[1] = b&lt;br /&gt;$array_out[2] = c&lt;br /&gt;Suppose that search_key= OR, as in the following:&lt;br /&gt;$array_out = array_keys($orig_array,”OR”);&lt;br /&gt;Then $array_out would contain the following:&lt;br /&gt;$array_out[0] = b&lt;br /&gt;array_merge&lt;br /&gt;Merges two or more arrays together. If more than one element has the same non-numeric key, only the last value for the key is added to the output array.&lt;br /&gt;Format: $bigArray = array_merge($array1,$array2, . . .);&lt;br /&gt;array_merge_recursive&lt;br /&gt;Merges two or more arrays. If more than one element has the same nonnumeric key, an array with all the values for the key is added to the output array. &lt;br /&gt;Format: $bigArray = array_merge($array1,$array2, . . .);&lt;br /&gt;array_pop --&gt; Removes and returns the last element in an array.&lt;br /&gt;Format: $element = array_pop($orig_array);&lt;br /&gt;array_push&lt;br /&gt;Adds the specified element(s) to the end of the array. Returns the new size of the array.&lt;br /&gt;Format: $new_size = array_push($orig_array,”el1”,”el2”,”el3”);&lt;br /&gt;array_reverse --&gt; Reverses the order of the items in $orig_array.&lt;br /&gt;array_search --&gt; Searches an array for a value. If value is found, key is returned.&lt;br /&gt;Format: $key = $array_search(“value”,$orig_array);&lt;br /&gt;array_slice&lt;br /&gt;Creates a new array that contains a subset of an existing array. Puts number of elements, beginning with start, into $subArray. &lt;br /&gt;Format: $subArray = array_slice($orig_array,start,number);&lt;br /&gt;array_sum --&gt; Adds all the values in an array. &lt;br /&gt;Format: $sum = array_sum($orig_array);&lt;br /&gt;array_unique --&gt; Removes duplicate elements from an array. &lt;br /&gt;Format: $array_out = array_unique($orig_array);&lt;br /&gt;arsort --&gt; Sorts an array by value in reverse order. &lt;br /&gt;Format: arsort($orig_array);&lt;br /&gt;assort  --&gt; Sorts an array by value, keeping the original keys. &lt;br /&gt;Format: asort($orig_array);&lt;br /&gt;compact&lt;br /&gt;Creates an array from the specified variables ($var1, $var2, and so on). The variables can be strings or arrays.&lt;br /&gt;Format: $array_out = compact($var1, $var2, . . .);&lt;br /&gt;Count  --&gt; Returns the number of elements in the array. &lt;br /&gt;Format: $size = count($orig_array);&lt;br /&gt;current  --&gt; Returns the value of the array element where the pointer is currently located.&lt;br /&gt;Format: $value = current($array);&lt;br /&gt;end --&gt; Moves the pointer to the last element in an array and returns the value. &lt;br /&gt;Format: $value = end($array);&lt;br /&gt;explode&lt;br /&gt;Creates an array containing substrings of a string. The specified separator, sep, which is generally something like a comma or a tab, divides the string into substrings. &lt;br /&gt;Format: $array_out = explode(“sep”,$string);&lt;br /&gt;extract&lt;br /&gt;Creates a set of variables, one for each element of an array. The key for the element is used as the variable name. &lt;br /&gt;Format: extract($array);&lt;br /&gt;implode&lt;br /&gt;Builds a string containing the values of all the elements in an array, separated by the specified separator. &lt;br /&gt;Format: $string = implode($array,”sep”);&lt;br /&gt;in_array&lt;br /&gt;Searches through the values in an array for a specified value. Returns TRUE or FALSE.&lt;br /&gt;Format: $bool = in_array(“value”,$array);&lt;br /&gt;key --&gt; Returns the key of the array element where the pointer is currently located.&lt;br /&gt;Format: $key = key($array);&lt;br /&gt;key_exists&lt;br /&gt;Checks an array to see whether it contains an element with the specified key. Returns TRUE or FALSE.&lt;br /&gt;Format: $bool = key_exists(“key”,$array);&lt;br /&gt;ksort, krsort&lt;br /&gt;Sorts the array by key. ksort sorts in ascending order, and krsort sorts in reverse (descending) order. &lt;br /&gt;Format: ksort($array); krsort($array);&lt;br /&gt;natsort, natcasesort&lt;br /&gt;Sorts an array by value in natural order. The order of the results is n1, n2, n12, n25, rather than n1, n12, n2, n25 in the usual sort. The function natcasesort works the same way but is case-insensitive.&lt;br /&gt;Format: natsort($array); natcasesort($array);&lt;br /&gt;next --&gt; Moves pointer in array to next element. &lt;br /&gt;Format: next($array);&lt;br /&gt;prev --&gt; Moves pointer in array to previous element. &lt;br /&gt;Format: prev($array);&lt;br /&gt;range&lt;br /&gt;Sets up an array with elements spanning a range of values. Possible ranges can be numerical (such as 1–10 or 10@nd1) or alphabetical (such as a–m or m–a).&lt;br /&gt;Format: $array_out = range(start,end);&lt;br /&gt;reset --&gt; Moves pointer to the first element in an array. &lt;br /&gt;Format: reset($array);&lt;br /&gt;sizeof --&gt; Returns the number of elements in an array. &lt;br /&gt;Format: $size = sizeof($array);&lt;br /&gt;sort, rsort&lt;br /&gt;Sorts array by value. sort sorts in ascending order, and rsort sorts in reverse (descending) order. &lt;br /&gt;Format: sort($array); rsort($array);&lt;br /&gt;Format: $array_out = array_reverse($orig_array&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-1325509731982364888?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/1325509731982364888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/array-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1325509731982364888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1325509731982364888'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/array-functions.html' title='Array Functions:'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-8836947884151730007</id><published>2009-01-31T22:12:00.000-08:00</published><updated>2009-01-31T22:13:41.409-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Date and Time Functions'/><title type='text'>Date and Time Functions</title><content type='html'>checkdate --&gt; Checks whether date is valid. Returns TRUE or FALSE.&lt;br /&gt;Format: checkdate(month,day,year);&lt;br /&gt;date, gmdate&lt;br /&gt;Converts a Unix timestamp into a formatted date. The function gmdate returns Greenwich Mean Time. Format: $formatted_date = date(“format”,$timestamp);&lt;br /&gt;getdate&lt;br /&gt;Creates an array from a Unix timestamp, each element containing part of the array, such as seconds, minutes, month, day of the year, and so on.&lt;br /&gt;Format: $array_date = getdate($timestamp);&lt;br /&gt;localtime&lt;br /&gt;Creates an array of values related to your local time, such as seconds, minutes, day of month, and so on.&lt;br /&gt;Format: $array_date = localtime($timestamp);&lt;br /&gt;Microtime  --&gt; Returns time in seconds and microseconds since January 1, 1970.&lt;br /&gt;Format: $time_out = microtime();&lt;br /&gt;mktime, gmmktime  --&gt; Returns a Unix timestamp. gmmktime uses Greenwich Mean Time.&lt;br /&gt;Format: $timestamp=mktime(“hrs”,”min”,”sec”,”mo”,”da”,”yr”);&lt;br /&gt;time --&gt; Returns the Unix timestamp for the current time.&lt;br /&gt;Format: $timestamp = time();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-8836947884151730007?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/8836947884151730007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/date-and-time-functions_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8836947884151730007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/8836947884151730007'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/date-and-time-functions_31.html' title='Date and Time Functions'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-9089209557468409850</id><published>2009-01-31T22:11:00.000-08:00</published><updated>2009-01-31T22:12:51.973-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='File system functions'/><title type='text'>File System Functions</title><content type='html'>basename  --&gt; Returns the filename from a full path.&lt;br /&gt;Format: $filename = basename(“path”);&lt;br /&gt;chdir --&gt; Change to a different directory. &lt;br /&gt;Format: chdir(“pathtodirectory”);&lt;br /&gt;chgrp --&gt; Changes the group for a file.&lt;br /&gt;Format: chgrp(“pathtofile”,”group”);&lt;br /&gt;chmod --&gt; Changes the permissions of the file.&lt;br /&gt;Format: chmod(“pathtofile”,”octalnumber”);&lt;br /&gt;chown --&gt; Changes the owner of a file.&lt;br /&gt;Format: chown(“pathtofile”,”newowner”);&lt;br /&gt;closedir --&gt; Closes the directory pointed to by the directory handle $dh.&lt;br /&gt;Format: closedir($dh);&lt;br /&gt;copy --&gt; Copies a file, resulting in two copies of the file. &lt;br /&gt;Format: copy(“oldfilename”,”newfilename”);&lt;br /&gt;dirname --&gt; Returns the directory from a path. &lt;br /&gt;Format: $directory_name = dirname(“path”);&lt;br /&gt;dis_total_space  --&gt; Returns the number of bytes of total space on the disk.&lt;br /&gt;Format: $space = disk_total_space(“path”);&lt;br /&gt;disk_free_space --&gt; Returns the number of bytes of free (unused) space.&lt;br /&gt;Format: $free = disk_free_space(“pathtodir”);&lt;br /&gt;fclose --&gt; Closes an open file pointed to by the file handle $fh. &lt;br /&gt;Format: fclose($fh);&lt;br /&gt;feof --&gt; Returns TRUE when the pointer reaches the end of the file. &lt;br /&gt;Format: feof($fh);&lt;br /&gt;fgetc&lt;br /&gt;Returns one character (the current character) and moves the pointer to the next character in the file.&lt;br /&gt;Format: $char = fgetc($fh);&lt;br /&gt;fgetcsv&lt;br /&gt;Reads a line of no longer than length from a file and returns it as an array, breaking it into elements at the specified separator, sep. &lt;br /&gt;Format: $array_out = fgetcsv($fh,length,”sep”);&lt;br /&gt;fgets, fgetss&lt;br /&gt;Reads a line from file of no longer than length. Does not return the end-ofline character. fgetss also strips tags from line. &lt;br /&gt;Format: $line = fgets($fh,length); $line=fgetss($fh,length);&lt;br /&gt;file --&gt;Reads a file and returns an array with one line per element. &lt;br /&gt;Format: $array_lines = file($fh);&lt;br /&gt;file_exists --&gt; Checks whether a specific file exists. Returns TRUE or FALSE. &lt;br /&gt;Format: $bool = file_exists(“pathtofile”);&lt;br /&gt;fileatime --&gt; Returns the time that the specified file was last accessed. &lt;br /&gt;Format: $timestamp = fileatime(“pathtofilename”);&lt;br /&gt;filectime --&gt; Returns the time that the specified file was created. &lt;br /&gt;Format: $timestamp = filectime(“pathtofilename”);&lt;br /&gt;filemtime --&gt; Returns the time that the specified file was last modified. &lt;br /&gt;Format: $timestamp = filemtime(“pathtofile”);&lt;br /&gt;fileowner --&gt; Returns the user ID of the owner of the file. &lt;br /&gt;Format: $userID = fileowner(“pathtofile”);&lt;br /&gt;fileperms --&gt; Returns the file permissions for the file.&lt;br /&gt;Format: $perms = fileperms(“pathtofile”);&lt;br /&gt;filesize --&gt; Returns the file size in bytes. &lt;br /&gt;Format: $size = filesize(“pathtofile”);&lt;br /&gt;filetype --&gt; Returns the file type, such a file or directory. &lt;br /&gt;Format: $type = filetype(“pathtofile”);&lt;br /&gt;flock --&gt; Locks a file so that no one else can access it until it’s unlocked.&lt;br /&gt;Format: flock($fh,mode);&lt;br /&gt;fopen --&gt; Opens a file and returns a pointer to the specified file. &lt;br /&gt;Format: $fh = fopen(“pathtofile”,”mode”);&lt;br /&gt;fputs&lt;br /&gt;Writes text to a file. Alias for fwrite. Returns the number of bytes written to the file or FALSE if the function fails. &lt;br /&gt;Format: $result = fputs($fh,”text”,length);&lt;br /&gt;fread --&gt; Reads number of bytes, unless it reaches the end of the file first, from a file.&lt;br /&gt;Format: $file_content = fread($fh,number);&lt;br /&gt;fscanf --&gt; Reads text from a file and returns a formatted string. &lt;br /&gt;Format: $string = fscanf($fh,”format”,$v1,$v2, . . .);&lt;br /&gt;fseek&lt;br /&gt;Moves the file pointer, depending on the next two parameters. The value specified in num is a number of characters. You can set mode to SEEK_SET (moves to char in position num), SEEK_CUR (moves num characters forward from current position), or SEEK_END (moves num characters back from the last character).&lt;br /&gt;Format: fseek($fh,num,mode);&lt;br /&gt;fwrite&lt;br /&gt;Writes text to the file indicated by $fh, stopping at length. Specifying length is optional. &lt;br /&gt;Format: $bytes_written = fputs($fh,”text”,length);&lt;br /&gt;getcwd --&gt; Returns the path to the current directory.&lt;br /&gt;Format: $current_directory = getcwd();&lt;br /&gt;getlastmod  --&gt; Returns the last modification date of the current script.&lt;br /&gt;Format: $timestamp = getlastmod();&lt;br /&gt;is_dir --&gt; Checks whether the specified path is a directory. &lt;br /&gt;Format: $bool = is_dir(“pathtodir”);&lt;br /&gt;is_file --&gt; Checks whether a specified file is a regular file, rather than a directory or special system file. &lt;br /&gt;Format: $bool = is_file(“pathtofile”);&lt;br /&gt;is_readable --&gt; Checks whether a specified file is readable. &lt;br /&gt;Format: $bool = is_readable(“pathtofile”);&lt;br /&gt;is_uploaded_file --&gt; Checks whether a specified file was uploaded via Web server form.&lt;br /&gt;Format: $bool = is_uploaded_file(“pathtofile”);&lt;br /&gt;&lt;br /&gt;is_writable --&gt; Checks whether a specified file is writable. &lt;br /&gt;Format: $bool = is_writable(“pathtofile”);&lt;br /&gt;link --&gt; Creates a hard link to path at newpath.&lt;br /&gt;Format: link(“path”,”newpath”);&lt;br /&gt;mkdir --&gt; Creates a new directory. The value specified in mode is permissions in octal form.&lt;br /&gt;Format: mkdir(“pathtonewdir”,mode);&lt;br /&gt;move_uploaded_file --&gt; Moves a file from its temporary upload directory to a permanent file. &lt;br /&gt;Format: move_uploaded_file(“filename”,”pathtodestination”);&lt;br /&gt;opendir --&gt; Opens a directory. Returns a pointer to the open directory. &lt;br /&gt;Format: $dh = opendir(“pathtodir”);&lt;br /&gt;passthru --&gt; Executes a system command and outputs the result. &lt;br /&gt;Format: passthru(“systemcommand”);&lt;br /&gt;pathinfo &lt;br /&gt;Creates an array with information about a path. The array contains three elements: dirname, basename, and extension.&lt;br /&gt;Format: $array_dir = pathinfo(“pathtodir”);&lt;br /&gt;readdir --&gt; Reads one filename from the open directory. &lt;br /&gt;Format: $filename = readdir($dh);&lt;br /&gt;readfile --&gt; Reads a file and outputs the contents. Can handle a URL.&lt;br /&gt;Format: $numberOfBytesRead = readfile(“pathtofile”);&lt;br /&gt;rename --&gt; Renames a file. &lt;br /&gt;Format: rename(“oldfilename”,”newfilename”);&lt;br /&gt;rewind --&gt; Sets a file pointer to beginning of the file referred to by $fh.&lt;br /&gt;Format: rewind($fh);&lt;br /&gt;rmdir --&gt; Removes a directory. &lt;br /&gt;Format: rmdir(“pathtodir”);&lt;br /&gt;tempnam --&gt; Generates a unique filename with a specified prefix in the directory.&lt;br /&gt;Format: $filename = tempnam(“pathtodir”,”prefix”);&lt;br /&gt;tmpfile&lt;br /&gt;Creates a temporary file with a unique name, opens it with write privileges, and returns a pointer to the open file.&lt;br /&gt;Format: $fh = tmpfile();&lt;br /&gt;touch&lt;br /&gt;Sets the modification date of a file. If time isn’t specified, it sets the date to the current time. If the file does not exist, it’s created.&lt;br /&gt;Format: $bool = touch(“pathtofile”,time);&lt;br /&gt;umask&lt;br /&gt;Sets the default permissions to mask and returns the previous mask. The previous defaults are restored at the end of the script.&lt;br /&gt;Format: $old_mask = umask(mask);&lt;br /&gt;unlink --&gt; Deletes a file. &lt;br /&gt;Format: unlink(“pathtofile”);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-9089209557468409850?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/9089209557468409850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/file-system-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/9089209557468409850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/9089209557468409850'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/file-system-functions.html' title='File System Functions'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-2067714290239087543</id><published>2009-01-31T22:10:00.000-08:00</published><updated>2009-01-31T22:11:29.144-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTTP and Mail Functions'/><title type='text'>HTTP and Mail Functions</title><content type='html'>get_browser&lt;br /&gt;Returns an object containing information about the user’s current browser or about the browser name if specified.&lt;br /&gt;Format: $string = get_browser(“name”);&lt;br /&gt;get_meta_tags&lt;br /&gt;Creates an array, each element of which is a name attribute for any meta tags found in a file.&lt;br /&gt;Format: $array_tags = get_meta_tags(“pathtofile”);&lt;br /&gt;header  --&gt; Sends an HTTP header to the Web server. &lt;br /&gt;Format: header(“HTTPformattedheader”);&lt;br /&gt;mail --&gt; Sends e-mail from a PHP script. &lt;br /&gt;Format: $success = mail(“to”,”subj”,”message”,”headers”);&lt;br /&gt;parse_url&lt;br /&gt;Returns an array, each element of which is a part of the URL, such as host, path, port, user, and so on.&lt;br /&gt;Format: $array_url = parse_url(“url”);&lt;br /&gt;setcookie --&gt; Creates a cookie.&lt;br /&gt;Format:&lt;br /&gt;setcookie(“name”,”value”,exp,”path”,”domain”,is_secure);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-2067714290239087543?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/2067714290239087543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/http-and-mail-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2067714290239087543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2067714290239087543'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/http-and-mail-functions.html' title='HTTP and Mail Functions'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-7487817872211583432</id><published>2009-01-31T22:09:00.000-08:00</published><updated>2009-01-31T22:10:33.119-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mathematical Functions'/><title type='text'>Mathematical Functions</title><content type='html'>abs --&gt; Returns the absolute value of number.&lt;br /&gt;Format: $absolute = abs(number);&lt;br /&gt;bindec --&gt; Converts binary to a decimal value.&lt;br /&gt;Format: $number_decimal = bindec(binary);&lt;br /&gt;exp --&gt; Returns the constant e raised to the power specified in exponent.&lt;br /&gt;Format: $number = exp(exponent);&lt;br /&gt;floor --&gt; Rounds float to the next lower integer.&lt;br /&gt;Format: $int = floor(float);&lt;br /&gt;hexdec --&gt; Converts hex (a number in hexadecimal form) to decimal.&lt;br /&gt;Format: $number_decimal = hexdec(hex);&lt;br /&gt;log --&gt; Returns the natural log of number.&lt;br /&gt;Format: $log = log(number);&lt;br /&gt;log10 --&gt; Returns the base-10 logarithm of number.&lt;br /&gt;Format: $log10 = log10(number);&lt;br /&gt;max --&gt; Returns the largest number found in an array or a list of numbers.&lt;br /&gt;Format: $num_large = max($array); or $num_large = max(num1,num2,. . .);&lt;br /&gt;min --&gt; Returns the smallest number found in an array or a list of numbers.&lt;br /&gt;Format: $num_min = min($array); or $num_min = min(num1,num2, . . .);&lt;br /&gt;number_format&lt;br /&gt;Formats a number with specified decimal (dec) and thousands separators (thous). The default is a standard decimal point (.) and a comma (,) for the thousands separators. &lt;br /&gt;Format: $formatted = number_format(number,”dec”’,”thous”);&lt;br /&gt;octdec --&gt; Converts a number in octal form to decimal form.&lt;br /&gt;Format: $number_decimal = octdec(octal);&lt;br /&gt;pow --&gt; Returns number raised to power.&lt;br /&gt;Format: $result = pow(number,power);&lt;br /&gt;rand --&gt; Returns a random number between min and max.&lt;br /&gt;Format: $number_rand = rand(min,max);&lt;br /&gt;round --&gt; Rounds number to the nearest number with the specified number of decimal places.&lt;br /&gt;Format: $result = round(number,dec);&lt;br /&gt;sqrt --&gt; Returns the square root of number.&lt;br /&gt;Format: $square_root = sqrt(number);&lt;br /&gt;&lt;br /&gt;srand --&gt; Seeds the random number generator with seed.&lt;br /&gt;Format: srand(seed);&lt;br /&gt;PHP Options and Information Functions This section contains functions that work with PHP options and information.&lt;br /&gt;getenv --&gt; Returns the value of an environmental variable.&lt;br /&gt;Format: $environment_value = getenv(“envvarname”);&lt;br /&gt;getlastmod --&gt; Gets the time that the current script was last modified.&lt;br /&gt;Format: $timestamp = getlastmod();&lt;br /&gt;ini_get --&gt; Gets the value for a configuration option.&lt;br /&gt;Format: $string = ini_get(“option”);&lt;br /&gt;ini_set --&gt; Sets the value of a configuration option. &lt;br /&gt;Format: ini_set(“option”,”setting”);&lt;br /&gt;phpinfo --&gt; Outputs information about your PHP version and settings.&lt;br /&gt;Format: phpinfo();&lt;br /&gt;phpversion --&gt; Returns the current PHP version.&lt;br /&gt;Format: $version = phpversion();&lt;br /&gt;putenv&lt;br /&gt;Sets an environments variable. The value indicated in setting is usually in the form name=value.&lt;br /&gt;Format: putenv(“setting”);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-7487817872211583432?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/7487817872211583432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/mathematical-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7487817872211583432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/7487817872211583432'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/mathematical-functions.html' title='Mathematical Functions'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-1022457973534638248</id><published>2009-01-31T22:07:00.000-08:00</published><updated>2009-01-31T22:09:29.173-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String Functions'/><title type='text'>String Functions</title><content type='html'>addslashes --&gt; Escapes single quotes, double quotes, backslashes, and \0 in strings.&lt;br /&gt;Format: $string_escaped = addslashes(“string”);&lt;br /&gt;base64_encode, base64_decode&lt;br /&gt;Encodes/decodes a string of base-64–coded characters, usually binary data.&lt;br /&gt;Format: $string_encoded = base64_encode(“string”);&lt;br /&gt;chop --&gt; Truncates blank spaces at the end of a string.&lt;br /&gt;Format: $chopped = chop(“string”);&lt;br /&gt;chr --&gt; Returns a single ASCII character for the number code.&lt;br /&gt;Format: $char = chr(code)&lt;br /&gt;count_chars &lt;br /&gt;Creates an associative array out of a string. Each element has a character as a key, and the value is the number of that character in the string. This function has some options for only returning characters with count 0 or with nonzero and others. Default, when no options is specified, is all characters.&lt;br /&gt;Format: $array = count_chars($string,option);&lt;br /&gt;echo --&gt; Outputs a list of one or more items. (See Chapter 3.)&lt;br /&gt;Format: echo item1,item2,item3, . . .&lt;br /&gt;ereg, eregi&lt;br /&gt;Searches a string for pattern. The function eregi works the same but is case-insensitive. (See Chapter 7.)&lt;br /&gt;Format: $bool = ereg(“pattern”,$string);&lt;br /&gt;ereg_replace, eregi_replace&lt;br /&gt;Searches a string for pattern &amp; replaces pattern with newchar.Ereg_replace is case-sensitive; eregi_replace is not.&lt;br /&gt;Format: $newstring = ereg_replace(“pattern”,”newchars”,$string);&lt;br /&gt;explode --&gt; Creates an array. Each element is part of the string, split at sep.&lt;br /&gt;Format: $array_out = explode(“sep”,$string);&lt;br /&gt;htmlentities --&gt; Converts HTML entities to special characters in a string.&lt;br /&gt;Format: $string_out = htmlentities($orig_string);&lt;br /&gt;htmlspecialchars  --&gt; Converts special characters to HTML entities, such as &amp; to &amp;amp;.&lt;br /&gt;Format: $string_out($string);&lt;br /&gt;implode --&gt; Joins every element in an array into a string, separated by sep.&lt;br /&gt;Format: $string_out = ($array,”sep”);&lt;br /&gt;nl2br --&gt; Inserts a &lt;br /&gt; before all new line characters (\n) in $string.&lt;br /&gt;Format: $string_out = ($string);&lt;br /&gt;ord --&gt; Returns the ASCII value of the first character in the string.&lt;br /&gt;Format: $integer = ord(“string”);&lt;br /&gt;parse_url --&gt; Creates an associative array. Each element is part of the URL.&lt;br /&gt;Format: $array = parse_url($url);&lt;br /&gt;print --&gt; Outputs item, where item can be a string, a number, or a variable.&lt;br /&gt;Format: print item;&lt;br /&gt;printf --&gt; Outputs a string formatted according to format. &lt;br /&gt;Format: printf(“format”,arg1,arg2,arg3, . . .);&lt;br /&gt;split, spliti --&gt; Creates array. Each element is part of a specified string, split based on the regular expression pattern. Split is case-sensitive; spliti is not.&lt;br /&gt;Format: $array = split(“pattern”,$string); $array =spliti(“pattern”,$string);&lt;br /&gt;sprintf --&gt; Returns a string formatted according to format. &lt;br /&gt;Format: $string = sprintf(“format”,arg1,arg2,arg3 . . .);&lt;br /&gt;str_pad&lt;br /&gt;Returns a string that is padded to make it number long. The character specified by pad is used to pad the string.&lt;br /&gt;Format: $string_out = str_pad($string,numberh,”pad”);&lt;br /&gt;str_repeat --&gt; Returns a string that contains $string repeated number times.&lt;br /&gt;Format: $string_out = str_repeat($string,number);&lt;br /&gt;str_replace --&gt; Finds all instances of oldtext in $string and replaces them with newtext.&lt;br /&gt;Format: $string_out = str_replace(“oldtext”,”newtext”,$string)&lt;br /&gt;strchr, strrchar&lt;br /&gt;The function strchr returns part of string from char to end of $string, and strrchar returns $string from char to start of string.&lt;br /&gt;Format: $string_part = strchr($string,”char”);&lt;br /&gt;strcmp, strcasecmp&lt;br /&gt;Compares two strings on alphabetical and numerical order . Returns @@n1 if str1 is less, 0 if two strings are equal, or +1 if str1 is greater. strcmp is casesensitive; strcasecmp is not.&lt;br /&gt;Format: strcasecmp($str1,$str2);&lt;br /&gt;strcspn --&gt; Returns the position of the first occurrence of char in $string.&lt;br /&gt;Format: $int = strcspn($string,”char”);&lt;br /&gt;strip_tags&lt;br /&gt;Removes HTML and PHP tags from string. The value allowed is optional and specifies tags that should not be stripped.&lt;br /&gt;Format: $string_stripped = strinp_tags($string,”allowed”);&lt;br /&gt;strlen --&gt; Returns the number of characters in $string.&lt;br /&gt;Format: $length = strlen($string);&lt;br /&gt;strpos, strrpos&lt;br /&gt;strpos returns the position of the first occurrence of char in $string. strrpos returns position of last occurrence of char in string.&lt;br /&gt;Format: $integer = strpos($string,”char”); $integer =strrpos($string,”char”);&lt;br /&gt;strspn&lt;br /&gt;Returns the length of the substring in $string that matches text.&lt;br /&gt;Format: $length = strspn($string,”text”);&lt;br /&gt;strstr, stristr  --&gt;Returns part of $string from the first occurrence of char to end of $string. Strstr is case-sensitive; trichar is case-insensitive.&lt;br /&gt;Format: $str_part = strstr($string,”char”); $str_part =strstr($string,”char”);&lt;br /&gt;strtolower, strtoupper  --&gt; Converts $string to lowercase or uppercase.&lt;br /&gt;Format: $string_lower = strtolower($string);&lt;br /&gt;strtr --&gt; Converts from characters in $string to characters in to.&lt;br /&gt;Format: $string_out = strtr($string,”from”,”to”);&lt;br /&gt;substr --&gt; Returns a substring of $string. Starts at start and reads number characters.&lt;br /&gt;Format: $substring = substr($string,start,number);&lt;br /&gt;substr_replace --&gt; Replaces a substring with newtext. Starts at start and reads number characters.&lt;br /&gt;Format: $string_new =substr_replace($string,”newtext”,start,number);&lt;br /&gt;trim, ltrim, rtrim&lt;br /&gt;Removes whitespace characters from $string. The trim function removes from beginning and end; ltrim removes from beginning; rtrim removes from end.&lt;br /&gt;Format: $string_new = trim($string);&lt;br /&gt;ucfirst --&gt; Converts first character in $string to uppercase.&lt;br /&gt;Format: $string_new = ucfirst($string);&lt;br /&gt;ucwords --&gt; Converts first character of each word in $string to uppercase.&lt;br /&gt;Format: $string_new = ucwords($string);&lt;br /&gt;wordwrap --&gt; Inserts end-of-line character (\r\n) into $string every length characters.&lt;br /&gt;Format: $string_out = wordwrap($string,length);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-1022457973534638248?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/1022457973534638248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/string-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1022457973534638248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1022457973534638248'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/string-functions.html' title='String Functions'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-2235081457224099107</id><published>2009-01-31T21:51:00.000-08:00</published><updated>2009-01-31T22:07:08.875-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Variable Functions'/><title type='text'>Variable Functions</title><content type='html'>empty  --&gt; Tests whether the variable specified is empty. &lt;br /&gt;Format: $bool = empty($varname);&lt;br /&gt;get_defined_classes&lt;br /&gt;Creates an array containing the names of all the classes in the script, including those in included files.&lt;br /&gt;Format: $array_classes = get_defined_classes();&lt;br /&gt;get_defined_constants --&gt; Creates an associative array of all the constants.&lt;br /&gt;Format: $array_constants = get_defined_constants();&lt;br /&gt;get_defined_functions --&gt; Creates an array with names of all functions.&lt;br /&gt;Format: $array_functions = get_defined_functions();&lt;br /&gt;get_defined_vars --&gt; Creates an array of all variables.&lt;br /&gt;Format: $array_vars = get_defined_vars();&lt;br /&gt;isset --&gt; Checks whether variable is set.&lt;br /&gt;Format: $bool = isset($varname);&lt;br /&gt;print_r --&gt; Outputs contents of a variable.&lt;br /&gt;Format: print_r($varname);&lt;br /&gt;putenv --&gt; Sets an environmental variable as specified by setting. setting is usually name=value.&lt;br /&gt;Format: putenv(“setting”);&lt;br /&gt;serialize&lt;br /&gt;Converts data into a string containing binary data. Used to store data in a file or database. The specified variable can be any type, including an object or a function.&lt;br /&gt;Format: $string_ser = serialize($variable);&lt;br /&gt;unserialize --&gt; Converts serialized data back to its original form.&lt;br /&gt;Format: $variable = unserialize($string_ser);&lt;br /&gt;unset --&gt; Removes a variable.&lt;br /&gt;Format: unset($varname);&lt;br /&gt;var_dump --&gt; Outputs contents of a variable.&lt;br /&gt;Format: var_dump($varname);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-2235081457224099107?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/2235081457224099107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/variable-functions_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2235081457224099107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/2235081457224099107'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/variable-functions_31.html' title='Variable Functions'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6830606489310006988.post-1786435301108968341</id><published>2009-01-28T19:46:00.000-08:00</published><updated>2009-01-28T19:51:31.872-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>User Contributed Notes in variable functions</title><content type='html'>example:&lt;br /&gt;&lt;br /&gt;It may be useful to note that 'variable functions' can only be used in conjunction with functions, and not language constructs such as echo, die, exit, etc.&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;&lt;br /&gt;If you want to call a static function (PHP5) in a variable method:&lt;br /&gt;&lt;br /&gt;Make an array of two entries where the 0th entry is the name of the class to be invoked ('self' and 'parent' work as well) and the 1st entry is the name of the function.  Basically, a 'callback' variable is either a string (the name of the function) or an array (0 =&gt; 'className', 1 =&gt; 'functionName').&lt;br /&gt;&lt;br /&gt;Then, to call that function, you can use either call_user_func() or call_user_func_array().  Examples:&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;class A {&lt;br /&gt;&lt;br /&gt;  protected $a;&lt;br /&gt;  protected $c;&lt;br /&gt;&lt;br /&gt;  function __construct() {&lt;br /&gt;    $this-&gt;a = array('self', 'a');&lt;br /&gt;    $this-&gt;c = array('self', 'c');&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  static function a($name, &amp;$value) {&lt;br /&gt;    echo $name,' =&gt; ',$value++,"\n";&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function b($name, &amp;$value) {&lt;br /&gt;    call_user_func_array($this-&gt;a, array($name, &amp;$value));&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  static function c($str) {&lt;br /&gt;    echo $str,"\n";&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function d() {&lt;br /&gt;    call_user_func_array($this-&gt;c, func_get_args());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function e() {&lt;br /&gt;    call_user_func($this-&gt;c, func_get_arg(0));&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class B extends A {&lt;br /&gt;&lt;br /&gt;  function __construct() {&lt;br /&gt;    $this-&gt;a = array('parent', 'a');&lt;br /&gt;    $this-&gt;c = array('self', 'c');&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  static function c() {&lt;br /&gt;    print_r(func_get_args());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function d() {&lt;br /&gt;    call_user_func_array($this-&gt;c, func_get_args());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function e() {&lt;br /&gt;    call_user_func($this-&gt;c, func_get_args());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$a =&amp; new A;&lt;br /&gt;$b =&amp; new B;&lt;br /&gt;$i = 0;&lt;br /&gt;&lt;br /&gt;A::a('index', $i);&lt;br /&gt;$a-&gt;b('index', $i);&lt;br /&gt;&lt;br /&gt;$a-&gt;c('string');&lt;br /&gt;$a-&gt;d('string');&lt;br /&gt;$a-&gt;e('string');&lt;br /&gt;&lt;br /&gt;# etc.&lt;br /&gt;?&gt;&lt;br /&gt;Storm&lt;br /&gt;04-May-2005 01:34&lt;br /&gt;This can quite useful for a dynamic database class:&lt;br /&gt;&lt;br /&gt;(Note: This just a simplified section)&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;class db {&lt;br /&gt;&lt;br /&gt;    private $host = 'localhost';&lt;br /&gt;    private $user = 'username';&lt;br /&gt;    private $pass = 'password';&lt;br /&gt;    private $type = 'mysqli';&lt;br /&gt;   &lt;br /&gt;    public $lid = 0;&lt;br /&gt;&lt;br /&gt;    // Connection function&lt;br /&gt;    function connect() {&lt;br /&gt;        $connect = $this-&gt;type.'_connect';&lt;br /&gt;           &lt;br /&gt;        if (!$this-&gt;lid = $connect($this-&gt;host, $this-&gt;user, $this-&gt;pass)) {&lt;br /&gt;            die('Unable to connect.');&lt;br /&gt;        }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;$db  = new db;&lt;br /&gt;$db-&gt;connect();&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;Much easier than having multiple database classes or even extending a base class.&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;&lt;br /&gt;A good method to pass around variables containing function names within some class is to use the same method as the developers use in preg_replace_callback - with arrays containing an instance of the class and the function name itself.&lt;br /&gt;&lt;br /&gt;function call_within_an_object($fun)&lt;br /&gt;{&lt;br /&gt;  if(is_array($fun))&lt;br /&gt;  {&lt;br /&gt;    /* call a function within an object */&lt;br /&gt;    $fun[0]-&gt;{$fun[1]}();&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  {&lt;br /&gt;    /* call some other function */&lt;br /&gt;    $fun();&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function some_other_fun()&lt;br /&gt;{&lt;br /&gt;  /* code */&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class x&lt;br /&gt;{&lt;br /&gt;  function fun($value)&lt;br /&gt;  {&lt;br /&gt;    /* some code */&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$x = new x();&lt;br /&gt;&lt;br /&gt;/* the following line calls $x-&gt;fun() */&lt;br /&gt;call_within_an_object(Array($x, 'fun'));&lt;br /&gt;&lt;br /&gt;/* the following line calls some_other_fun() */&lt;br /&gt;call_within_an_object('some_other_fun');&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;&lt;br /&gt;Finally, a very easy way to call a variable method in a class:&lt;br /&gt;&lt;br /&gt;Example of a class:&lt;br /&gt;&lt;br /&gt;class Print() {&lt;br /&gt;    var $mPrintFunction;&lt;br /&gt;&lt;br /&gt;    function Print($where_to) {&lt;br /&gt;        $this-&gt;mPrintFunction = "PrintTo$where_to";&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    function PrintToScreen($content) {&lt;br /&gt;        echo $content;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    function PrintToFile($content) {&lt;br /&gt;        fputs ($file, $contents);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;.. .. ..&lt;br /&gt;&lt;br /&gt;    // first, function name is parsed, then function is called&lt;br /&gt;    $this-&gt;{$this-&gt;mPrintFunction}("something to print");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;&lt;br /&gt;Try the call_user_func() function.  I find it's a bit simpler to implement, and at very least makes your code a bit more readable... much more readable and simpler to research for someone who isn't familiar with this construct.&lt;br /&gt;anpatel at NOSPAM_cbu dot edu&lt;br /&gt;18-Mar-2002 04:11&lt;br /&gt;Yes interpolation can be very tricky. I suggest that you always use parenthesis, or curly brackets(whichever applies) to make your expression clear.&lt;br /&gt;&lt;br /&gt;Dont ever depend on a language's expression parse preference order.&lt;br /&gt;retro at enx dot org&lt;br /&gt;14-Jan-2002 02:18&lt;br /&gt;Another way to have php parse a variable within an object as a function is to simply set a temporary variable to its value. For example:&lt;br /&gt;&lt;br /&gt;$obj-&gt;myfunction = "foo";&lt;br /&gt;$x = $obj-&gt;myfunction;&lt;br /&gt;$x(); // calls the function named "foo"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6830606489310006988-1786435301108968341?l=htmlandphp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://htmlandphp.blogspot.com/feeds/1786435301108968341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/user-contributed-notes-in-variable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1786435301108968341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6830606489310006988/posts/default/1786435301108968341'/><link rel='alternate' type='text/html' href='http://htmlandphp.blogspot.com/2009/01/user-contributed-notes-in-variable.html' title='User Contributed Notes in variable functions'/><author><name>html and php</name><uri>http://www.blogger.com/profile/05809430139875726857</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
