Wie kann ich nen string mit semikolons getrennt nacheinander in ein Array legen?!?
Gruß Manfred
Gruß Manfred
function load() {
global $temp_adr_id, $id, $kateg;
$kategorie = explode(";", $kateg);
print_r($kategorie);
echo "<form name=\"kateg\" method=\"post\" action=\"kateg.php?action=write&temp_adr_id=$temp_adr_id\">";
$read_003 = mysql_query("SELECT * FROM msc_kateg ORDER BY name");
while(list($id, $name) = mysql_fetch_row($read_003))
{
if ($kategorie == $name)
{
echo "<input type=\"checkbox\" name=\"kateg[]\" value=\"$name\" checked> $name<br>";
}
else
{
echo "<input type=\"checkbox\" name=\"kateg[]\" value=\"$name\"> $name<br>";
}
}
echo "<input type=\"submit\" name=\"Submit\" value=\"Abschicken\">
</form>";
}
function load() {
global $temp_adr_id, $id, $kateg;
$kategorie = explode(";", $kateg);
print_r($kategorie);
echo "<form name=\"kateg\" method=\"post\" action=\"kateg.php?action=write&temp_adr_id=$temp_adr_id\">";
$read_003 = mysql_query("SELECT * FROM msc_kateg ORDER BY name");
while(list($id, $name) = mysql_fetch_row($read_003))
{
if (in_array($name, $kategorie))
{
echo "<input type=\"checkbox\" name=\"kateg[]\" value=\"$name\" checked> $name<br>";
}
else
{
echo "<input type=\"checkbox\" name=\"kateg[]\" value=\"$name\"> $name<br>";
}
}
echo "<input type=\"submit\" name=\"Submit\" value=\"Abschicken\">
</form>";
}
Array ( [0] => MX [1] => Privat )
K
x MX
Privat
Array ( [0] => MX [1] => Privat )
Kommentar