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

Rohit Poonia
PLUS
Rohit Poonia
Courses Plus Student 1,698 Points

$arr vs $names

Hello Hampton Paulk,

My question is related to the argument you've used in the above video. for ex:-

You've used $arr as an argument for array.

but for storing the names you've used different variable $names ?? why

I mean is it necessary to pass the $arr for array ?? or their is some other trick which i am not understanding ??

Please Help.

Best Regards, Rohit

1 Answer

rdaniels
rdaniels
27,258 Points

variables can be anything(pretty much) that you want to use. using "arr" is just easier to understand that it is an array that you are working with. Using "names" as a variable is pretty explicit. It helps you to not guess what the variable is referencing.... it could be "x" or "y" or anything really, but using those as variable names will make you guess what they are days or months down the road... Hope this helps...