|
|
|
|
![]() ![]() |
Jul 28 2008, 11:37 AM
Post
#1
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 8 Joined: 22-July 08 From: Pitcairn, PA Member No.: 31,591 |
First off, we need to meet each other. I am Archimedes! xD I chose this name because I have a joy for mathematics and calculators and such. Archimedes is the man who discovered Pi(3.14159).
Things you should know before we start Lesson #1. 1.HTML 2.General scripting knowledge or what it actually does. Alright, to the PHP lessons. 1.PHP stands for PHP; Hypertext Preprocessor. 2.PHP is used all around the world to build dynamic web pages and web sites. Basic Syntax 1. All PHP scripts start with the<?php or <? tag. I'd use the <?php tag just to be a little bit more tidy, just my opinion though. 2. To write something in PHP, we use the 'echo' or 'print' statement, like so. CODE <?php echo "Hello Astahost!"; ?> Output: Hello Astahost! 3. All PHP statements end with a semicolon( Comments 4. To type comments in PHP we use // for one line comments or /* */ to make a comment block, like in this example. Comments DO NOT end with a semicolon. CODE <?php //This is a one lined comment(has no effect on the script, whatsoever) echo "Hello Astahost!"; /* This is a Comment block(has no effect on the script, whatsoever) */ ?> Output: Hello Astahost! Variables 5. At school, you use variables to substitute for numbers. Like, 4f + f = d. f=2, therefore 4*2+2=10. d=10. 6. In PHP, variables are 'saved' with the USD sign($). CODE <?php $text = "Hello"; $number = 4; echo $text; ?> Output: Hello 8. To type 2 variables after each other, you'd separate them with '. " " .', like so. CODE <?php $text = "Hello"; $number = 4; echo $text . " " . $number; ?> Output: Hello 4 Operators Operator - Name - Ex. - Output + - Addition - x=2. 4 + x - 6 - - Subtraction - x=2. 4 - x - 2 * - Multiplication - x=2. 4 * x - 8 / - Division - x=2. 4 / x - 2 For a list of all operators, click here. That's it for our first lesson, see ya soon! The Human Calculator, Archimedes This post has been edited by Archimedes: Jul 31 2008, 06:56 PM |
|
|
|
Jul 28 2008, 12:55 PM
Post
#2
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 2,186 Joined: 16-August 05 Member No.: 7,896 myCENTs:61.17 |
Nice tuto, thanks.
Just a stupid question. You say "PHP stands for PHP; Hypertext Preprocessor." How do you make php with Hypertext Preprocessor ? It should sound more like hpp ? |
|
|
|
Jul 28 2008, 07:02 PM
Post
#3
|
|
|
Super Member Group: [HOSTED] Posts: 737 Joined: 12-July 06 From: Ontario, Canada Member No.: 14,464 |
Just a stupid question. You say "PHP stands for PHP; Hypertext Preprocessor." How do you make php with Hypertext Preprocessor ? It should sound more like hpp ? PHP = PHP: Hypertext Preprocessor http://en.wikipedia.org/wiki/Recursive_acronym This post has been edited by FirefoxRocks: Jul 28 2008, 07:03 PM |
|
|
|
Jul 28 2008, 08:18 PM
Post
#4
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 2,186 Joined: 16-August 05 Member No.: 7,896 myCENTs:61.17 |
Now I see : QUOTE PHP — PHP: Hypertext Preprocessor (originally "Personal Home Page" tools, officially changed for PHP 3 "Personnal Home Pages" is understandable for PHP, it's a nice historical explanation. |
|
|
|
Sep 14 2008, 10:39 AM
Post
#5
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 1 Joined: 14-September 08 Member No.: 32,639 |
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 22nd November 2008 - 02:41 PM |