Jump to content
xisto Community
Sign in to follow this  
HannahI

Learning Php - Part 1 Learn PHP for Beginners

Recommended Posts

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:

<?phpecho "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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.