|
[Tutorial] Getting started
|
|
07-08-2009, 05:28 PM
Post: #1
|
|||
|
|||
|
Getting started with php
Getting started in Php Lets get to know the common, useful functions of Php... A php file uses an extension of : .php | Example : index.php When you start a php file you will always use "<?php" to start the script, and to close the script you use "?>". Example : PHP Code: <?phpPhp files normally contain HTML tags, just like HTML files, and some php scripting code. Here is an example of a simple Php script which sends the text "Hello World" to the browser. Example : PHP Code: <html>Each php code line ends with a semicolon ";" this is used to separte one set of instructions to another. There are two basic statements to output text with PHP: echo and print. In the example above we have used the echo statement to output the text "Hello World". Note: The file must have a .php extension. If the file has a .html extension, the PHP code will not be executed. Php Comments Php comments can be quite important, obviously to help you remember and guide you, but if you release a php file, you normally write about each part of the script. To start a comment beside/above/below the script you must use "//" If you are doing more than one line comment you must use "/*" followed by "*/" Example : PHP Code: <html>Enjoy, and make sure you don't miss out on the next tutorial.. |
|||
|
07-10-2009, 07:10 AM
(This post was last modified: 07-10-2009 07:10 AM by ffs.)
Post: #2
|
|||
|
|||
|
RE: [Tutorial] Getting started
very useful i think. and more clear than the *How To* guides i have googled
![]() (but still dont get a thing >.<.... examples. wer did u kno to add <body> and what it does) and <html> // why this? <body> // n what this does? <?php // this i know. it starts the script rite? echo "Hello World"; // why echo? ?> // this ends the script if im rite </body> // these again :/ </html> // - || - |
|||
|
07-11-2009, 01:32 PM
Post: #3
|
|||
|
|||
RE: [Tutorial] Getting started
(07-10-2009 07:10 AM)ffs Wrote: very useful i think. and more clear than the *How To* guides i have googled Oh Well <html> is like the website code, you always start with when making a full web page. <body> is the body of the web page. <?php is the script yes echo "" prints text </"> ends code. |
|||
|
10-30-2011, 11:17 PM
Post: #4
|
|||
|
|||
|
RE: [Tutorial] Getting started
nice tutorial i think ^^
|
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)









