PHP Default Argument Values Function

PHP allows you to define C++ style default argument values. In such case, if you don’t pass any value to the function, it will use default argument value.

Let’ see the simple example of using PHP default arguments in function.

Example 1

Output:

Example 2


Output:

Example 3


Output:

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *