I want make function with 3 parameter, first parameter is $field
, second parameter is $condition
and last parameter is $value
.
the function what I make like this:
function where($field, $condition = ' = ', $value);
i want call the function run with this code :
->where('name', 'andi')
and condition will be the default ( = ).
it's easy if $condition in last parameter, but i want $condition in middle.
if i call the function only with 2 parameter, how to know second parameter is $value not $condition ? any idea ?
thank you in advance.
SOLVED with func_num_args()