Mailinglisten-Archive |
Hi Florian,
$count = count($for_country);
for($k=0;$k<$count_country;$k++)
{
if($for_country[$k] == "####")
array_splice($for_country, $k, 1);
#unset($for_country[$k]);
}
geht leider auch nicht!? es wird zwar der Inhalt (sprich ####) gelöscht, es
existiert aber immer noch der Index mit einem leeren Inhalt. Ich möchte den
Inhalt samt Index löschen ...
@Lutz: benütze natürlich nur die Variable $count ... der Fehler ist nur bei
der Mail beim umkopieren passiert ... die for-schleife läuft durch ... aber
danke :)
> Hallo Andy,
>
> >versuche, erfolglos, ein Element aus einem array zu löschen. folgende
> >Situation:
> >
> >Inhalt vom array:
> >for_country[0]=Albania##2
> >for_country[1]=Bosnia And Herzegowina##27
> >for_country[2]=####
> >
> >$count = count($for_country);
> >for($k=0;$k<$count;$k++)
> >{
> > if($for_country[$k] == "####")
> > unset($for_country[$k]);
> >}
> >
> >es klappt aber nicht!! was muss ich anstellen um for_country an der
> stelle 2
> >komplett zu löschen??
> >
> >
> Versuch's mal mit array_splice($for_country, $k, 1);
>
> Gruß
> Florian
>
> --
>
> common visions media.agentur
> knieperstrasse 1
> 18439 stralsund
>
> phone 0049 [0] 38 31 . 30 31 57
> fax 0049 [0] 38 31 . 30 31 58
> mobil 0049 [0] 170 . 83 32 281
>
> f.kieling at covi.de
> http://www.covi.de
>
> --
> ** Allgemeine deutschsprachige PHP-Liste: php at phpbar.de **
> Informationen: http://www.phpbar.de
> http://lists.phpbar.de/mailman/listinfo/php
>
php::bar PHP Wiki - Listenarchive