- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
<?
$vars=array("№1" => "volvo", "№2" => "saab","№3" => "saab & audi", "№4" => "mercedes","№5" => "audi");
echo "<table border=1>";
foreach ($vars as $k => $v) {
echo "<tr><td>".$k."</td><td>".$v."</td></tr>";
}
echo "</table>";
?>
<form action="index.php" method="POST">
<select name="parametr">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="saabandaudi">Saab & Audi</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
<input type="submit" value="JMI">
</form>
<?
if (isset($_POST['parametr']) && !empty($_POST['parametr'])) {
foreach ($vars as $k => $v) {
if (strstr(strtolower($v),strtolower($_POST['parametr']))) {
echo $k." - ".$vars[$k]."<br>";
}
}
} else {
echo "<table border=1>";
foreach ($vars as $k => $v) {
echo "<tr><td>".$k."</td><td>".$v."</td></tr>";
}
echo "</table>";
}
?>