Mailinglisten-Archive |
> >
> > define ("KONS_TANTE","hallo");
> >
> > $x = "TANTE";
> >
> > echo KONS_$x;
>
> wie wärs mit:
>
>
> $x = "TANTE";
> define( 'KONS_' . $x, "hallo" );
>
Danke, aber da kann ich die Konstante nur dyn. erzeugen ich will sie aber
dyn abrufen (Schleifen!)
define ("KONS_TANTE","hallo");
define ("KONS_ONKEL","hallo2");
$array = array("TANTE","ONKEL");
foreach ($array as $x) {
echo KONS_$x;
}
Ich hoffe, jetzt versteht man es besser
Danke
Wolfi
php::bar PHP Wiki - Listenarchive