Hallo ich habe folgende Frage. Ich lasse mir verschiedene DS aus einer DB ausgeben in einer Auswahlliste und übergebe als value, das create_time des DS. Jetzt möchte ich aber noch den brand_launch mitübergeben.
PHP-Code:
<?PHP
............
$array[$months]['create_time'][] = $row["create_time"];
foreach ($array as $months => $value) {
echo"<option value='".implode (",", $value['create_time'])."|$months'>$months</option>";
}
?>
Das sieht im html-quelltext so aus:
Code:
<option value='08/05,08/05|2-3 years'>2-3 years</option>
<option value='08/05|more than 5 years'>more than 5 years</option>
So jetzt möchte ich aber noch den brand_launch mitübergeben. Baue ich das dann mit in das Array ein ? Das brand_launch hat das gleiche
Format z.B. 04/99.
Kann ich das so machen ?
PHP-Code:
<?PHP
$array[$months]['create_time'][] = $row["create_time"];
$array[$months]['brand_launch'][] = $row["brand_launch"];
foreach ($array as $months => $value) {
echo"<option value='".implode (",", $value['create_time'])."|
".implode (",", $value['brand_launch'])."|
$months'>$months</option>";
?>
Geht das so, oder ist das total quatsch, rein programmiertechnisch ?
Es soll so ungefähr aussehen im html.
Code:
<option value='08/05,08/05|02/03|2-3 years'>2-3 years</option>
Danke.