Connection failed: could not find driver
<!-DOCTYPE html>
<html>
<head>
<title>Lesson 8</title>
<link rel="stylesheet" href="/css/general.css" media="all">
<link rel="stylesheet" href="/css/menu.css" media="all">
</head>
<body>
</body>
</html>
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>
Company | Contact | Country |
---|---|---|
Alfreds Futterkiste | Maria Anders | Germany |
Centro comercial Moctezuma | Francisco Chang | Mexico |
de switch() function works more or less like the if else structure. It takes an argument and depending of its value it will do something.
$var = 10;
if ( $var == 10 ) {
echo 'Exactly 10';
} else {
echo 'NOt 10';
}
switch($var){
case 10:
echo 'Exactly 10';
break;
default:
echo 'NOT 10';
break;
}
switch($beer)
{
case 'tuborg';
case 'carlsberg';
case 'stella';
case 'heineken';
echo 'Good choice';
break;
default;
echo 'Please make a new selection...';
break;
}
if ( $beer == 'tuborg' ||
$beer == 'carlsberg' ||
$beer == 'stella' ||
$beer == 'heineken' ) {
echo 'Good choice';
} else
echo 'Please make a new selection...';
}