Maybe this isn’t possible, I’ve never seen it myself, but thought I’d ask. If this is my array,
$myarr = array(
'red' => 7,
'green' => 7,
'blue' => 18,
'cyan' => 14,
'pink' => 18
'brown' => 18
);
is there a way while initializing the array to set similar values at once? like
'red' && 'green' =>7,
'blue' && 'pink' && 'brown' => 18,
'cyan' =>14
of course I’m not expecting this syntax to work but is there something that gets me the same idea?
PHP Manual does not provide description of any way to do that. BTW, you may initialize values in the following way: