Received: from hotmail.com (oe35.law4.hotmail.com [216.33.148.28]) by postgresql.org (Postfix) with ESMTP id 885A6475B12 for ; Thu, 25 Apr 2002 13:18:10 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 25 Apr 2002 10:18:10 -0700 X-Originating-IP: [212.9.66.13] From: "Areski Belaid" To: , "Julio Cuz, Jr." References: <200203130916.g2D9GLfd020708@artemis.cuci.nl> <5.1.0.14.0.20020425085709.00aba940@mail.rccd.cc.ca.us> Subject: Re: Variables Date: Thu, 25 Apr 2002 19:18:06 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0015_01C1EC8D.ED68D960" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: X-OriginalArrivalTime: 25 Apr 2002 17:18:10.0110 (UTC) FILETIME=[2C487DE0:01C1EC7D] X-Archive-Number: 200204/91 X-Sequence-Number: 1115 This is a multi-part message in MIME format. ------=_NextPart_000_0015_01C1EC8D.ED68D960 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi the Community, A good exemple, it's always better that a long... You must use the eval fonction. (www.php.net) \";" ); //just to see no important eval( "\$c$count =3D \"$artist[$count]\";" );=20 eval( "echo \"-->\".\$c$count.\"

\";" );//just to see no important }=20=20 ?> I have the following variables: $c1 thru $c10.=20 a.. I also have a FOR loop like this:=20 for($count =3D 0; $count < sizeof($artist); $count++) { echo "$artist[$count]
"; }=20 // $artist is a list of ten (10) artist's names.=20 a.. What I'm trying to do is something like this: Combine the variable= s with the info inside the FOR loop:=20 for($count =3D 0; $count < sizeof($artist); $count++) { //Trying to assign the value of $c1, $c2, $c3, etc. us= ing the value of the variable $count. //But so far, it only processes the value of $count al= one, and it ignores $c //The line below should read like this: $c1 =3D $artist[= 0], next line: $c2 =3D $artist[1], etc. $c . $count+1 =3D $artist[$count]; }=20 Help!!! Julio Cuz, Jr. Riverside Community College jcuz@rccd.cc.ca.us=20 ------=_NextPart_000_0015_01C1EC8D.ED68D960 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi the Community,
 
A good exemple, it's always better that a= =20 long...
You must use the eval fonction. (www.php.net)
 
<?
$artist[]=3D"Areski1";
$artist[]=3D"Areski2";
$arti= st[]=3D"Areski3";
$artist[]=3D"Areski4";
 
$c0=3D"Kiki1";
$c1=3D"Kiki2";
$c2=3D"Kiki3";
$c3=3D"Kiki4= ";
 
for($count =3D 0; $count < sizeof($arti= st);=20 $count++)
 {  
  eval( "echo=20 \$c$count.\"<br>\";" ); //just to see no important
  eva= l(=20 "\$c$count =3D \"$artist[$count]\";" ); 
  eval( "echo=20 \"-->\".\$c$count.\"<br><br>\";" );//just to see no=20 important
    }  
?>
 
I have the following=20 variables: $c1 thru $c10.
  • I also have a FOR loop like this:=20
        = for($count=20 =3D 0; $count < sizeof($artist);=20 $count++)
                {=20 echo "<i>$artist[$count]</i><br>"; }=20
        // $ar= tist=20 is a list of ten (10) artist's names.=20
  • What I'm trying to do is something like this:  Combine the=20 variables with the info inside the FOR loop:=20
     = ;   for($count=20 =3D 0; $count < sizeof($artist);=20 $count++)
                { = =20 //Trying to assign the value of $c1, $c2, $c3, etc. using the value of th= e=20 variable=20 $count.
                  = ;=20 //But so far, it only processes the value of $count alone, and it ignores= =20 $c
                
//The=20 line below should read like this:  $c1 =3D $artist[0], next line:&nb= sp; $c2=20 =3D $artist[1],=20 etc.
                
 &= nbsp;      $c=20 . $count+1 =3D=20 $artist[$count];
       &nbs= p;        }= =20

Help!!!

Julio Cuz, Jr.
Riverside Community=20 College
jcuz@rccd.cc.ca.us

------=_NextPart_000_0015_01C1EC8D.ED68D960--