Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

PHP Functions Course (How To)

via Treehouse

Overview

PHP Functions allow you to combine several statements of code into a 'function'. These functions can then be called by their given name, and all of the code contained will run and return the results. This will drastically help you clean up code and use less repetitive code.

What you'll learn

  • Function Basics
  • String Functions
  • Array Functions
  • Closures
  • Named Functions

Syllabus

Introducing Functions

The very basics of how custom functions in PHP work is what you will learn here. We will leave understanding how a function is structured as well as how to pass in arguments and set defaults for those arguments.

Chevron 4 steps
  • Introducing Functions

    6:52

  • PHP Function Arguments

    6:11

  • PHP Function Default Arguments

    6:58

  • PHP Functions Basics

    5 questions

Function Returns and More

In most cases we will want to do more than just echo a value inside of our functions, in order to do that we will need to have the function 'return' a value. This way we are able to store data from a function call to any type of value variable. We will go into this and more functions types in this stage.

Chevron 4 steps
  • Returning Values

    7:51

  • PHP Variable Functions

    5:25

  • PHP Closures

    4:14

  • PHP Function Returns

    4 questions

PHP Internal Functions

PHP has tons of built in functions to make your life as a PHP developer so much better. We will learn how to find these internal functions, read the docs, and use them!

Chevron 5 steps
  • PHP Built-Ins and Documentation

    2:26

  • PHP String Functions

    8:59

  • PHP Array Functions

    8:11

  • PHP Functions Next Steps

    0:42

  • PHP Internal Functions

    5 questions

Taught by

Hampton Paulk

Reviews

Start your review of PHP Functions Course (How To)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.