bookmark - Learning Php - Part 1 Learn PHP for Beginners

Learning Php - Part 1 - Learn PHP for Beginners

 
 Discussion by HannahI with 0 Replies.
 Last Update: November 18, 2009, 6:20 pm
 
bookmark - Learning Php - Part 1 Learn PHP for Beginners  
    
free web hosting
 
Hello,
In this tutorial, I'll be teaching PHP.
Before we start, let's talk about the basics of PHP.
You will need a server. If you're on a Mac, Google "Mamp"; if you're on a Linux, Google "Lamp"; if you're on a Windows, Google "Wamp".
Your files will go in the Mamp, Wamp, or Lamp folder's htdocs.
PHP stands for Php Hyper-Text Processing.
PHP is a [HIGHLIGHT=yellow]Server Language[/HIGHLIGHT], which means that it runs on the server vs. the computer.
Now let's Begin
Chapter 1-1 - Beginning
Every line in PHP [HIGHLIGHT=yellow]ends in a semi-colon[/HIGHLIGHT].
99.9% of the time [HIGHLIGHT=yellow]is lower-case[/HIGHLIGHT].
Every thing is [HIGHLIGHT=yellow] inside <?php and ?>[/HIGHLIGHT].
Chapter 1-2 - Beginning
A simple, but heplful command is echo which prints HTML on the screen; if you don't understand this, go learn HTML.
Example:

CODE

<?php
echo "Hello!";
?>

If you do that, you should see the following.
Preview:
Hello!
To create a [abbr=a word that is eqeal to another word or number]variable[/abbr], type $, then the the name (no space), type =, then type a number; if you want it to equal some text, put quotes/single quotes around it.
To put a variable within a echo statement do it like this.
Example:

CODE

<?php
$hello = "Hello";
echo 'Hello is equal to';
echo $hello
?>

or

CODE

<?php
$hello = "Hello";
echo "Hello is equal to';
echo $hello;
?>

or

CODE

<?php
$hello = "Hello";
echo 'Hello is equal to' . $hello . ' ';
?>

Thanks For Reading Chapter 1!

Written by HannahI

Wed Nov 18, 2009    Reply    New Discussion   


Quickly Post to Learning Php - Part 1 Learn PHP for Beginners w/o signup Share Info about Learning Php - Part 1 Learn PHP for Beginners using Facebook, Twitter etc. email your friend about Learning Php - Part 1 Learn PHP for Beginners Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print

Php Counter   Php Counter (4) (2) Learning Php - Part 2   Learning Php - Part 2