有没有办法改进以下if
语句块?我只是想知道是否有人可以使这段代码更简单、更干净。
if($key == 'insert'){
$permission[] = '1';
}else if($key == 'inter-insert'){
$permission[] = '2';
}else if($key == 'intra-insert'){
$permission[] = '3';
}else if($key == 'view'){
$permission[] = '4';
}else if($key == 'inter-view'){
$permission[] = '5';
}else if($key == 'intra-view'){
$permission[] = '6';
}else if($key == 'update'){
$permission[] = '7';
}else if($key == 'inter-update'){
$permission[] = '8';
}else if($key == 'intra-update'){
$permission[] = '9';
}else if($key == 'delete'){
$permission[] = '10';
}else if($key == 'inter-delete'){
$permission[] = '11';
}else if($key == 'intra-delete'){
$permission[] = '12';
}