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:

Please follow and like us:

Leave a Reply

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