PHP. How can i check if a Switch case statement has executed? -


is possible check if switch case statement has found match in case part , executed successfully, , if doesn't, how execute else?

eg

switch($type)  {     case "1": {         echo "something";         break;     }     case "2": {         echo "something else";         break;     } }  

on simple level...

switch ($type)  {     case "1":         // code executed         echo('executed 1');         break;     case "2":         // code executed         echo('executed 2');         break;     case "3":         // code executed         echo('executed 3');         break;     default:         // code executed if different other conditions; } 

your syntax incorrect also... help?


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -