Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Functions Introducing Functions PHP Function Arguments

Miguel Nunez
Miguel Nunez
3,266 Points

I simple terms what is a php function?

What is the purpose of a function and what does it do when you put it in your php code in simple terms with out using fancy scientist words lol.

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

A php function is a block of code that is set aside from other parts of your file that performs a specific action. The purpose of a function is to help give your code some structure, make it easier to read :)