How can I make an optional argument in my custom function in PHP?

shrshr471

New Member
For example, here's a quick dummy function that sums it up:\[code\]function dummy_func($optional){ if (!isset($optional) { $optional = "World!"; } $output = "Hello " . $optional; return $output;}\[/code\]However, if I run this, I get an E_WARNING for a missing argument. How can I set it up so it doesn't flag an error?
 
Back
Top