I’m working on an app, and I’m stuck.
I want to do foreach
inside switch
like this:
<?PHP
$gtid = $_GET['id'];
// ID(key) => value
$dbs = array(
"ZTI10" => "Example1",
"O1JTQ" => "Example2",
"4V1OR" => "Example3"
);
switch($gtid){
foreach ($dbs as $key => $value) {
case $key:
echo "On ID $key is $value";
break;
}
}
?>
Is that even possible? Or is there any other way to do what I want here?
Thanks in advance.