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
A sometimes useful concept inside of PHP is that of variable functions. This is a way for you to use a variable's value to call a function of the same name.
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
This is a way for you to use a variable's
value to call a function of the same name.
0:00
This way if a variable name has
parenthesis appended to it, PHP will look
0:02
for a function with the same name as
whatever the variable evaluates to,
0:07
and then will attempt to execute it.
0:11
We will use this mostly as a callback in
our code,
0:14
allowing us to call different functions
from another function or
0:16
from an action based off of the result of
the main function.
0:19
Let's go to Workspaces and look at this a
bit closer.
0:23
>> Okay.
So, let's open up some php tags here and
0:27
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