Mailinglisten-Archive |
hi, ich hab eben mal ein bissel rumprobiert und eine lösung gefunden, die
hoffentlich auch bei dir funzt...
for ($m = 2; $m <= $spalten; $m++) {
$a = "spalte";
$b = "$m";
$c = $a.$b;
echo(" <td width=\"${$c}\"> </td>\n");
}
also statt $$c einfach ${$c} und dann gehts...
MfG
Henning
----- Original Message -----
From: "Matthias Kunze" <info_(at)_mk2000-online.de>
To: <php_(at)_php-center.de>
Sent: Sunday, December 24, 2000 10:30 PM
Subject: Re: [php] variablen aus formular
> hi!
>
> > und nu zu einem beispiel was das ganze veranschaulicht:
> >
> > $spalte2="Hallo";
> > $a="spalte";
> > $b="2";
> > $c=$a.$b;
> > echo($$c);
> >
> >
> > >while ($m <= $spalten) {
> > > $m++;
> > > echo(" <td width=\"$spalte$m\"> </td>\n");
> > > ^^^^^^^^^
>
> erstmal danke für den tipp. jetzt wird aber folgender code ausgegeben:
>
> <tr>
> <td width="100"> </td>
> <td width="$spalte2"> </td>
> <td width="$spalte3"> </td>
> <td width="$spalte4"> </td>
> <td width="$spalte5"> </td>
> <td width="$spalte6"> </td>
> <td width="$spalte7"> </td>
> </tr>
>
> es sollen aber die werte und nicht die variablennamen ausgegeben werden.
> hier noch mal das script:
>
> for ($m = 2; $m <= $spalten; $m++) {
> $a = "spalte";
> $b = "$m";
> $c = $a.$b;
> echo(" <td width=\"$$c\"> </td>\n");
> }
> echo(" </tr>\n");
>
>
> Matthias
>
> --
> HTML- & Webdesign-Tipps _(at)_ http://www.mk2000-online.de
> Fragen und eMails an mailto:mk_(at)_mk2000-online.de
>
>
>
>
>
>
> --
> ** Durchgehend geöffnet: http://www.php-center.de **
> Die PHP-Liste: mailto:php_(at)_php-center.de
> http://infosoc.uni-koeln.de/mailman/listinfo/php
>
php::bar PHP Wiki - Listenarchive