[PHP] Learn PHP :)

Status
Not open for further replies.

Nick

New Member
Sep 24, 2010
14
0
PHP:
 Learn PHP - Part 1[/b]

Welcome too my second tutorial here on DevBest Forums, today you WILL learn PHP :)

Lets Get Started....

[B]What Does PHP Stand For?
[/B]PHP Stands For [U]Hypertext Preprocessor.

[/U]Every PHP Script begins the same, doesnt matter what your doing in a php script every new script must begin the same as the last.

To begin a new script open notepad.exe and type the following.

[PHP]<?php
The Code <?php opens our script.

-----------------------------------------------------------------------------------

Now in this tutorial were only going to make a simple "Hello World" script which will display the text "Hello World" on page.

So... Type your opening code
PHP:
<?php
Now you need to use the ECHO function which is built into the PHP scripting enviroment.

And Example is below:
PHP:
echo("Hello World");
Notice between your text there are two quote marks - all text must be kept within these quotes otherwise they will return an error. For Example:

PHP:
echo(Hello World);
- This would return an error.

-------------------------------------------------------------------------------------

Now moving on we now need to learn how to end our script. Just like opening the script its just flipped around with some things removed... an example of how to close your script is below:
PHP:
?>
-------------------------------------------------------------------------------------

Thats it so lets take alook at the overall code:

PHP:
<?php
echo("Hello World");
?>
-------------------------------------------------------------------------------------

Now save that file as "hello_world.php" and save it ither on your local test server or upload it too your website (FTP).

So heres the steps below....

Step 1
You must be registered for see images attach


Step 2
You must be registered for see images attach


Step 3
You must be registered for see images attach


Thats it from me ... if you dont understand somthing just leave a comment below and ill try and explain it a little more :)

Peace out..
Nick.
 

RyanMK

Still alive
May 27, 2010
802
117
Very nice tutorial, Nick. Maybe post a screenshot of the end result for people who don't understand exactly what it does.
 

Nick

New Member
Sep 24, 2010
14
0
Very nice tutorial, Nick. Maybe post a screenshot of the end result for people who don't understand exactly what it does.

Thankyou for this suggestion Retroa.. ill get right onto it! :)
 
Nov 23, 2010
307
2
i never knew you can do it via
PHP:
echo("")
learned something new today!

EDIT : PHP doesnt stand for Hypertext Preprocessor , it stand for PHP Hypertext Preprocessor , because without "PHP" in it it would be HP , many peoples does that mistake
 
Status
Not open for further replies.

Users who are viewing this thread

Top