PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
bimo
Forum Contributor
Posts: 100 Joined: Fri Apr 16, 2004 11:18 pm
Location: MD
Post
by bimo » Fri Apr 16, 2004 11:18 pm
Now this doesn't seem like it would be aa difficult problem to solve but for the life of me I can't figure it out. Here's the code snippet:
Code: Select all
<?php
$langFromArray[] = "";
for($i = 0; $i <2; $i++) {
$langFromArray[$i] = $myVars[$i];
}
$langFrom = $langFromArray[0] . langFromArray[1];
print("This was translated from " . $langFrom ".");
?>
I keep getting this error:
Parse error: parse error, unexpected '[' in f:\student-iat\dynamic\hsphar\homework\translationservice\hermesita-d3-go.php on line 180
180 is the line inside of the for loop.
Any ideas?
holly
?>
bimo
Forum Contributor
Posts: 100 Joined: Fri Apr 16, 2004 11:18 pm
Location: MD
Post
by bimo » Fri Apr 16, 2004 11:25 pm
I'm sorry, the error is on this line:
$langFrom = $langFromArray[0] . langFromArray[1];
which is after the for loop.
h
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Apr 17, 2004 12:11 am
your second langFromArray doesn't have a $ infront of it.
bimo
Forum Contributor
Posts: 100 Joined: Fri Apr 16, 2004 11:18 pm
Location: MD
Post
by bimo » Sat Apr 17, 2004 12:25 am
Like I said, stupid. I could've sworn that it was there when I checked... Thanks.
h