首页 > 代码库 > Switch Case语句中多个值匹配同一个代码块的写法

Switch Case语句中多个值匹配同一个代码块的写法

switch ($p) {     case ‘home‘:     case ‘‘:         $current_home = ‘current‘;    break;     case ‘users.online‘:     case ‘users.location‘:     case ‘users.featured‘:     case ‘users.new‘:     case ‘users.browse‘:     case ‘users.search‘:     case ‘users.staff‘:         $current_users = ‘current‘;    break;    case ‘forum‘:         $current_forum = ‘current‘;    break; }