Jump to content

using switches


balistic

Recommended Posts

$action = $_GET['action'];

if($action){

$array = array('put','your','actions','in','this','array');

if(in_array($action,$array)){
	switch($action){
	case put: include "inc/put.php"; break;
	case your: include "inc/your.php"; break;
	case actions: include "inc/actions.php"; break;
	case in: include "inc/in.php"; break;
	case this: include "inc/this.php"; break;
	case array: include "inc/array.php"; break;
	}
}else {
echo "Invalid action!\n";
}
}else {
echo "No action valid!\n";
}

Link to comment
https://forums.phpfreaks.com/topic/64461-using-switches/#findComment-321368
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.