ordering array keys?
i want to create an array with 2 keys and i want them in following order:
$array['higher'];
$array['escalate'];
how could i accomplish this without creating any value.
i want to add values to the array with later on...
$array['higher'][] = 'some_value';
$array['escalate'][] = 'some_value';
...but fi开发者_Go百科rst i need to create the keys in that order.
thanks in advance!
I think there's no easier way than
$array = array("higher" => null, "escalate" => null);
You can simply define it without adding values
$array['A'] = NULL;
$array['B'] = NULL;
精彩评论