Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed PHP Functions!
You have completed PHP Functions!
Preview
In PHP functions are everywhere. Put simply a function is a way for us to organize and group statements of code. Let's learn how these functions work.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Put simply a function is a way for us to
organize and group statements of code.
0:00
This code can then be wrapped with a name
that will allow us to
0:03
call this same group of code over and
over.
0:06
Functions can be described with the
following analogy.
0:09
A coffee pot would be a function called
make coffee.
0:13
The coffee pot takes coffee grounds and
water.
0:16
Then it heats the water and pours the
water over the coffee,
0:19
finally, through a filter, returning a cup
of liquid coffee.
0:22
Functions in most cases will be returning
a value based off of supplied input,
0:26
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up