Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Dec 4th, 2006, 8:21 PM   #1
kworden
Newbie
 
Join Date: Dec 2006
Posts: 3
Rep Power: 0 kworden is on a distinguished road
Adding a # value to the end of another variable

What I'm trying to do is display a list of Values with A # value added to after the original value it represents...

See an example below:
[PHP]
$ga1 = 4;
$ga2 = 3;
$ga3 = 1;
$ga4 = 2;
$ga5 = 4;
$ga6 = 2;

$numberofgaquestions = 34;

for($i=1; $i<= $numberofgaquestions; $i++ ){
echo "The # $i: ". $ga$i ."<br>";
}
[/PHP]

The result I'm looking for is:
The # 1: 4
The # 2: 3
The # 3: 1
The # 4: 2
The # 5: 4
The # 6: 2

I get an error saying "Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' " So how can i add the # value to another variable?

Thanks for your help in advance....

K
kworden is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is this declaring a variable? waveform C++ 21 Jun 23rd, 2006 3:48 PM
Compiling Maverik 6.2 (from C) megamind5005 C 16 May 3rd, 2006 5:41 PM
Pointers in C (Part II) Stack Overflow C 2 Apr 29th, 2005 10:39 AM
Pointers in C (Part I) Stack Overflow C 4 Apr 28th, 2005 7:03 PM
variable problem robert_sun C 1 Apr 12th, 2005 2:10 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:14 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC