What I'm wanting to do is be able to create the additional arguments on the fly from an array. So in the above example it would be like this:
$type = "left"; $var1 = "10"; $var2 = "abcdef"; $var3 = "255"; $display = setFunction($type, $var1, $var2, $var3);
I'm trying to create a shortcut so I can call a function to build my setFunction call from an array rather than have to always declare and build it each time.
$type = "left"; $myvars = array("10", "abcdef", "255"); // here is where I want some magic to happen that would create the variables that would then be appended to the function call. // so you simply build the array and it creates the $var1, $var2, $var3 or how ever many variables you have based on the number of elements in the array. $display = setFunction($type, magic variable variables here);
From novice to tech pro — start learning today.