PHP function building a default variables?
function, php
Solution
ex($a, $c) // WANT VAR C TO BE VAR C IN THE FUNCTION AND NOT VAR B
Skip second param:
ex($a, null, $c);
Learn more on official docs
Problem
I am trying to build a function that has 2 default values, but on some occasions I need to supply only the first argument, and others only the second. Is there a way in PHP that I can do this, or is there a way of doing what I want that is considered standard? Example ``` function ex($a, $b = null, $c = null) { .... } ex($a, $b, $c) // WORKS FINE ex($a) // WORKS FINE ex($a, $b) // WORKS FINE ex($a, $c) // WANT VAR C TO BE VAR C IN THE FUNCTION AND NOT VAR B ``` Thanks