PHP for Beginners

PHP for Beginners: Learn to Code in PHP Using Real World Examples! PHP for Beginners Course 2016
4.5 (61 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
2,448 students enrolled
Take This Course
  • Lectures 138
  • Length 6 hours
  • Skill Level Beginner Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works


Find online courses made by experts from around the world.


Take your courses with you and learn anywhere, anytime.


Learn and practice real-world skills and achieve your goals.

About This Course

Published 7/2015 English

Course Description


STUDENT REVIEW: "If you want a no-fluff, straight-to-the-point, engaging, practical, fun and beginners course in PHP, then this is the course you are looking for. 
This course introduces you to the fundamentals of PHP. In no time, you will be writing scripts ranging from fairly simple to complex. The instruction is structured in such a way that you grab the basics very quickly and get to practice what you have learned in practical exercises. 
The instructor's delivery is engaging throughout the entire length of the course and the length of each video is just right so you are not bored and tempted to visit other websites.
I'm giving this course 5 stars because of the practice exercises which does a great deal in developing your mental muscles. 
I could go on and on but all I am trying to say is you aren't going to find any course on Udemy which teaches you the fundamentals of PHP and gives you the confidence to write awesome programs."

Students consistently say how much they LOVE this course due to its unique delivery method and challenges which enable you to use your new skills immediately.

This PHP for beginners course introduces you to PHP through carefully crafted examples and fully worked mini tasks. LEARNING by DOING is what this course is all about. You will experience real world examples of PHP code use.

Have you seen other courses that use complex terms or that jump steps and leave you thinking "why did that just happen"? You won't find that with this carefully crafted course.

This course has been designed with the coding beginner in mind or those who may have picked up bad habits and wish to refresh their coding skills.

On hand to help and guide you is a renowned national award-winning teacher who has taught 1000s of students over a career of over 25 years.

Highlights of this course include:

  • Full code from every example and mini task shared with you online
  • Carefully crafted challenges and full solutions with FULL explanations of every line
  • Demonstration of a shared coding environment
  • Dozens of real world examples with more added on a regular basis
  • A tutor who cares about his students
  • Regular updates and new challenges

If you want to learn PHP and take your first steps into the world of web development then this PHP for Beginners course is for you.

Every line of code is explained in full detail to ensure that you can progress from absolute beginner to competent coder in a few weeks.

Launch yourself onto a new career path by taking this course now.


There is absolutely no risk with a full 30 day money-back guarantee.

Enrol now.

What are the requirements?

  • Have access to a computer with internet connection and browser
  • Some HTML and CSS knowledge would be beneficial but the tutor will explain everything as he goes

What am I going to get from this course?

  • a true PHP for Beginners course with step-by-step lessons
  • learn how to code using PHP from a national award-winning teacher
  • you will be taken from absolute PHP beginner to confident coder with every step clearly explained
  • create dozens of useful PHP scripts
  • create a Rock Paper Scissors game
  • create a basic hit counter via sessions
  • create a 2 player Tic Tac Toe game
  • create a bad word filter
  • create a 'How many days until Christmas' script
  • create and use HTML forms and process the data using PHP
  • create, read, update and delete sessions and cookies
  • access to regularly updated content including lesson notes, downloadable code, HD quality video tutorials, and quizzes
  • 25 PHP coding challenges (more added regularly) with full video solutions and downloadable PHP code
  • access real world coding challenges and examples including full video solutions and downloadable code
  • manipulate words and sentences (strings) using string functions
  • use mathematical operators e.g. addition, subtraction, multiplication, division (and more) to solve practical problems e.g. calculate the area of a circle if the user inputs the radius or diameter
  • use loops to simplify processes
  • use conditional statements to test properties and action processes based on the result
  • create and use simple arrays and solve problems involving array functions
  • use associative arrays and manipulate them using array functions
  • use PHP internal functions and create your own
  • use the date() function to perform calculations based on date
  • a tutor who responds quickly to questions and who regularly updates the course
  • 30 day money back guarantee!
  • ...and much more!

Who is the target audience?

  • No PHP coding experience is required - this is a true PHP for Beginners course
  • Complete beginners to PHP are welcome and encouraged to enrol
  • Anyone interested in learning PHP at a basic to intermediate level
  • If you are looking to learn complex Object Oriented Programming (OOP) then this course is not for you

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.


Section 1: Introduction

A brief overview of this PHP for Beginners course and an introduction to your instructor.

I will briefly introduce some of the concepts covered in the course and explain who should consider taking this course.


PHP for Beginners: In this brief lesson I show you how to access the higher quality videos.


PHP for Beginners: An update about the changes to CodeAnywhere


PHP for Beginners: In this lesson we set up the PHP development environment and look at some of the settings available.


PHP for Beginners: I show you how to access the code snippets and downloadable files within the course.

Throughout the course you will find various resources for each coding lesson.

I hope you find the downloadable files and code snippets useful.

Section 2: PHP Basics

We follow the coding tradition and start with Hello, World!

The 'Hello, World!' script is a common starting point for most coding courses and we follow this traditional starting point in PHP for Beginners.


Learn how to start a PHP code block and how to avoid and handle some basic common errors.

  • closing php tags and when and why we can omit them
  • missing semi-colons
2 pages

Learn how to name a variable correctly in PHP.

  • What are PHP variables
  • How do you name a variable in PHP

You will learn how to assign values to variables in PHP


We will briefly look at the PHP online resource manual and see what data types are available for us to use.


How to use PHP echo and print functions to view code output.


Get into good habits early and comment your code!

I show you how to add comments to your PHP code and how to comment out sections of code.

5 questions

A quick check of your understanding of variables in PHP

Section 3: Basic Operators

Just as important as being able to code is being able to keep organised. Taking some time to create a few folders will help you in the long term.

We look at how the name of the folders and files affects what we see in the browser.


You will learn how to use the addition + operator in PHP.

We will also look at shortcut methods for adding numbers.


You will learn how to multiply and divide numbers in PHP


You will learn how to use the modulus operator.


You will learn how to raise a number to a given power


In this challenge you will create a basic calculator


Solution for the back to school challenge

2 pages

Downloadable file containing the code for the back to school challenge

Section 4: Assignment, Conditional and Logical Operators

PHP for Beginners: Learn how to join strings and variables using concatenation in PHP

1 page

A mini challenge to test your understanding of concatenation.


The full video solution to the WHAT'S IN A NAME challenge


The full code of the solution to the WHAT'S IN A NAME challenge


In this lesson we look at concatenation of sentences.

There are a few methods you can use to concatenate, mostly involving the use of single or double quotes and how we concatenate variables. It is down to personal preference how you concatenate. I prefer to have my variables outside of the quotes like this:

echo "The area of the circle is :" . $area . " cm squared";


We review the PHP comparison operators


We review the the PHP logical operators


In this lecture you will learn how to increase and decrease a variable value

Section 5: IF Statements

You will learn how to use the IF statement


You will learn how to use the IF ELSE statement


You will learn how to use the ELSEIF statement

Section 6: Basic Loops

In this PHP for Beginners lesson you will learn how to use a FOR loop.

Loops are very important and extremely useful when cycling through variable values, particularly when it comes to using database records (although we don't cover that in this course).

There are different methods we can employ to loop through values and the FOR loop in PHP is just one such way.


You will learn how to use a WHILE loop

1 page

Time for another challenge. In this task you have to create a loop which will create a 6 times table


Video solution for the multiplication tables task


Code for the multiplication tables task

1 page

In this challenge you need to replicate the game of FIZZ BUZZ


Video solution for the Fizz Buzz challenge


Code for the fizz buzz challenge

4 questions

This quiz will test your understanding of loops.

Section 7: PHP Internal (in-built) Functions

You will learn how to use the PHP reference manual


You will learn how to generate a random number in PHP

1 page

In this challenge you will generate a random number between 1 and 2. If the random number is 1 then echo "Heads, I win!" otherwise echo "Tails, you win!"

Check out the extension task too!


Video solution of the GIVE ME A HIGH 5 task


Downloadable code for the GIVE ME A HIGH 5 task

1 page

In this task you need to calculate the area of a circle using the PI() function and then the ROUND() function to round your answer.


Video solution to the WHO ATE ALL THE PI task


Downloadable code for the WHO ATE ALL THE PI task


How to use the date() function in PHP

1 page

In this task you will have to format various dates by using the DATE() function


Video solution to the CARPE DIEM task


Downloadable code for the CARPE DIEM task


We look a little bit more at some of the available date functions before taking on the next challenge.

1 page

This tasks involves counting the number of days until Christmas.


Video solution to the SANTA CLAUS IS COMING TO TOWN challenge


Downloadable code to the SANTA CLAUS IS COMING TO TOWN challenge.

Section 8: How to create a form in HTML and send data to a PHP script

You will learn how to create a basic HTML page structure including:

  • doctype
  • tag use
    • opening and closing tags
  • head section and title
  • body section

You will learn the structure of a basic form and create one from scratch. No styling will be applied. We will just focus on the form structure.


You will learn how to send your form data to a PHP processing script. You will then learn how to check that data has been sent and how to assign it to variables.

1 page

This task involves creating a user input form and taking the temperature input and converting it from degrees C to degrees F


Video solution to the temperature conversion task


Downloadable file containing the code to the temperature conversion task

5 questions

A few questions to check your understanding of the concepts so far

Section 9: More Internal Functions: Working with strings

You will learn how to use strlen() in order to find the length of a string


In this lesson I show you how to count the number of words in a sentence.

1 page

In this task you will accept a user input and check the length of the string and then tell them how long the string is.


Video solution to the HOW LONG IS A PIECE OF STRING challenge


Downloadable code for the HOW LONG IS A PIECE OF STRING challenge


In this lesson I show you how to replace characters in a string. This function has many uses, one of which could be as a bad word filter.


In this lesson we look at the str_shuffle() function

1 page

Yesterday you received a strange message from HQ which simply said: str_rot13()

Today you received a long coded message:

Rafher gung lbh orpbzr snzvyvne jvgu cuc shapgvbaf nf gurl ner rkgerzryl hfrshy.

Your task is to decode the message and act on it.


Solution to the MISSION IMPOSSIBLE challenge



//original messsage

$message = "Ensure that you become familiar with php functions as they are extremely useful.";

//coded message

$encoded = str_rot13($message);

echo $encoded;

echo "<br>";

//decoding the message

$return = str_rot13($encoded);

echo $return;


In this lesson we look at the difference between double and single quotes.


In this lesson we look at how we can escape strings. I show you the use of double and single quotes.

1 page

In this challenge you will escape strings in order to have valid output. Not as easy as it first sounds!


The video solution to THE GREAT ESCAPE challenge


Downloadable code for THE GREAT ESCAPE challenge

Section 10: How to create and use basic ARRAYS and array functions

You will learn what an array is in PHP


You will learn how to output data from an array. This is extremely useful for when we start to connect with databases.


You will learn how to split an array at a given point and in a given length using array_slice()

2 pages

In this task you will:

  • create a user input form
  • create a script to check if it is a valid ISBN number

Video tutorial solution to the ISBN checker challenge


Downloadable file of the solution to the ISBN checked challenge

1 page

In this challenge you will use your knowledge of arrays and strings to filter out inappropriate words from user inputs


Video solution for the MIND YOUR LANGUAGE challenge

Challenge 14: Mind your language! - CODE

In this lesson you will learn how to sort data in an array and then output the results.

I will show you the following functions:

  • sort()
  • rsort()

You will learn how to use the explode() and implode() functions on strings.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Patrick Morrow, National Award-Winning Teacher & Premium Udemy Instructor

Patrick is a very experienced teacher who is consistently recognised for helping students achieve their true potential. This quality has been recognised by the National Teaching Awards with Patrick awarded Outstanding Teacher of the Year. Other establishments including Her Majesty's Inspectorate in the UK use his models as examples of best practice. Patrick is a Google Certified Educator and was invited by Apple to participate in the Apple Distinguished Leaders Program 2016.

Patrick has been featured on television and in the Financial Times, ISP World, and Computer Weekly.

He has taught students at all levels, has been guest speaker at multiple conferences and has been invited by a top university to 'lecture anytime'.

"Patrick is not only a quality teacher, he is a mover and motivator of minds."

"A genius of his profession."

"Of course this guy's popular, he's the definition of a perfect teacher in a myriad of so many imperfect ones."

Ready to start learning?
Take This Course