My system sends a configuration array to a function like this:
callThatFunction( array(k1 => v1, k2 => v2, ... kn=vn));
I want to make one of the key value pairs, conditional upon some circumstances.
Can I do this without creating a variable for the array (and this breaking the clean config syntax that someone else had created)?
Like this
callThatFunction ( array(
k1 => v1,
if($cond( {k2 => v2,}
...
kn=vn));
The above is obviously wrong syntactically, but should express my idea.
Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…