1. 程式人生 > >Switch Case語句中多個值匹配同一個代碼塊的寫法

Switch Case語句中多個值匹配同一個代碼塊的寫法

har com arch mssql pre html www ase cas

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; 
}
http://www.cnblogs.com/mssql8/p/3864197.html

  

Switch Case語句中多個值匹配同一個代碼塊的寫法