Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Replying to Learning Php - Part 1


Post Options

    • Can't make it out? Click here to generate a new image

  or Cancel


Topic Summary

HannahI

Posted 18 November 2009 - 06:20 PM

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 Server Language, which means that it runs on the server vs. the computer.
Now let's Begin
Chapter 1-1 - Beginning
Every line in PHP ends in a semi-colon.
99.9% of the time is lower-case.
Every thing is inside <?php and ?>.
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:
<?php
echo "Hello!";
?>
If you do that, you should see the following.
Preview:
Hello!
To create a variable, 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:
<?php
$hello = "Hello";
echo 'Hello is equal to';
echo $hello
?>
or
<?php
$hello = "Hello";
echo "Hello is equal to';
echo $hello;
?>
or
<?php
$hello = "Hello";
echo 'Hello is equal to' . $hello . ' ';
?>
Thanks For Reading Chapter 1!

Written by HannahI

Review the complete topic (launches new window)