"php default arguments" Answer’s

0

You can use either:

example($argument1, '', 'test');

Or

example($argument1, NULL, 'test');

You can always check for NULL using instead of empty string:

if ($argument === NULL) {
    //
}

I think it all depends on what happens inside the function with the args.

Wednesday, March 31, 2021
 
Zach
answered 11 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :