Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
PHP – Conditional Statements | Loops | Functions | Arrays
Rating: 4.0 out of 5(2 ratings)
479 students

PHP – Conditional Statements | Loops | Functions | Arrays

Learn and understand fundamental PHP Skills
Last updated 3/2026
English

What you'll learn

  • Setup PHP Development Environment
  • Create Conditional statements
  • Create functions
  • Create Arrays
  • Create Loops

Course content

6 sections27 lectures1h 47m total length
  • Overview of PHP Conditional Statements, Loops, Functions, Arrays1:17
  • Introduction0:20
  • What is PHP0:36
  • Setting up PHP6:37
  • Xampp tour6:57
  • PHP Data Types5:21
  • Note on Text Editors0:01

Requirements

  • Basic knowledge of PHP advised

Description

Very often when you write code, you want to perform different actions for different conditions. You can use conditional statements in your code to do this.

In PHP we have the following conditional statements:

  • if statement - executes some code if one condition is true

  • if...else statement - executes some code if a condition is true and another code if that condition is false

  • if...elseif...else statement - executes different codes for more than two conditions

  • switch statement - selects one of many blocks of code to be executed.


The real power of PHP comes from its functions.


  • PHP has more than 1000 built-in functions, and in addition you can create your own custom functions.


  • A function is a block of statements that can be used repeatedly in a program.

  • A function will not execute automatically when a page loads.

  • A function will be executed by a call to the function.

An array stores multiple values in one single variable:


Often when you write code, you want the same block of code to run over and over again a certain number of times. So, instead of adding several almost equal code-lines in a script, we can use loops.


  • Loops are used to execute the same block of code again and again, as long as a certain condition is true.

In PHP, we have the following loop types:


  • while - loops through a block of code as long as the specified condition is true

  • do...while - loops through a block of code once, and then repeats the loop as long as the specified condition is true

  • for - loops through a block of code a specified number of times

  • foreach - loops through a block of code for each element in an array


Who this course is for:

  • Beginners to PHP