PHP Basics Course

Go to class
Write Review

Free Online Course: PHP Basics Course provided by Treehouse is a comprehensive online course, which lasts for 2-3 hours worth of material. The course is taught in English and is free of charge.

Overview
  • In this course I'll walk you through the basics of the language, ranging from basic statements to conditionals. We'll be creating a simple "Unit Converter" as well as a "Daily Exercise Program". We'll then finish up by combining those programs with HTML to create a personal webpage to demonstrate your skills.

    What you'll learn

    • Variables
    • Operators
    • Conditionals
    • Comments
    • PHP on the Web

Syllabus
  • Getting to Know PHP

    PHP is one of the most widely used technologies on the internet today, supporting many large projects such as WordPress, Drupal, Wikipedia and Facebook. A conservative estimate is that 25% of the web is built on PHP. The driving force behind PHP has always been; to solve problems, and make it faster and easier to build web sites. Because of this drive, PHP is a great choice for creating simple yet powerful web sites and applications.

    Chevron 6 steps
    • Getting Started with PHP

      3:35

    • Intro to Workspaces and PHP Code

      3:53

    • Getting Started With PHP

      5 questions

    • PHP Basic Usage

      1 objective

    • PHP Comments

      5:16

    • PHP Comments

      5 questions

    Unit Converter

    PHP has 2 types of number variables: integers, for whole numbers such as 1 though 9, and floats, for fractions such as the cost of 1.99. In this course we'll be creating a simple unit converter which will use these number variables, along with arithmetic operators, to calculate weight and distance conversions.

    Chevron 8 steps
    • Variables in PHP

      3:40

    • Integers

      5:19

    • Floats

      2:30

    • Number Variables

      5 questions

    • Arithmetic Operators

      5:43

    • Mathematical Manipulations

      5 questions

    • Creating a Unit Conversion Tool

      6:43

    • Manipulating Numbers

      3 objectives

    • Extra Credit

      1. Reverse the operations:
        • Convert Kilograms to Pounds
        • Convert Kilometers to Miles.
      2. Convert Fahrenheit to Celsius
      3. Choose your own conversion

    Daily Exercise Program

    In this section, we'll continue to expand upon the skills you've learned, as we explore more data types and the logic needed to create a "Daily Exercise Program". We'll store each exercise in a STRING variable, then we'll use conditionals to control which exercise is displayed.

    Chevron 12 steps
    • Strings

      3:43

    • Escape Sequence

      4:28

    • Escaping Strings

      6 questions

    • Combining Strings

      5:34

    • String Manipulation

      3 objectives

    • Booleans

      3:02

    • Comparing Values

      4:53

    • True PHP

      2 objectives

    • Adding Logic to Your Programs

      6:25

    • Conditionals

      1 objective

    • Daily Exercise Program

      6:24

    • Review Basics

      5 questions

    PHP on the Web

    In this section, we'll use PHP in combination with HTML to create your first PHP webpage. You'll learn how PHP can reduce busy work and maintenance, allowing us to work faster and be more productive. Finally we'll combine the previous scripts to create a personal webpage to demonstrate your skills.

    Chevron 9 steps
    • HTML and PHP

      3:08

    • Don't Repeat Yourself

      3:35

    • HTML with PHP

      5 questions

    • Let PHP Do the Work

      5:34

    • Date Function

      1 objective

    • Combining Multiple Files with Includes

      3:58

    • Including PHP

      1 objective

    • What's Next?

      0:54

    • Final Quiz

      10 questions