HELP HELP - 5 months ago 50
PHP Question

What is a Parameter in PHP?

I was wondering what exactly is a parameter in PHP?


A parameter is anything you pass to a function or method. It can be some value stored in a variable, or a literal value you pass on the fly. They are also known as arguments.

some_function($some_param, "some other param");

It's kind of like using a blender to make a smoothie: the blender is the function, the ingredients and the milk you put in the blender to blend are the parameters/arguments, and the smoothie is the return value :)

$banana_smoothie = make_smoothie('banana', 'milk');

You can also see similar analogies in the PHP manual entry I link to (makecoffee() and makeyogurt()).