Page 1 of 1

[SOLVED] probably stupid

Posted: Fri Apr 16, 2004 11:18 pm
by bimo
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
?>

Posted: Fri Apr 16, 2004 11:25 pm
by bimo
I'm sorry, the error is on this line:

$langFrom = $langFromArray[0] . langFromArray[1];

which is after the for loop.

h

Posted: Sat Apr 17, 2004 12:11 am
by feyd
your second langFromArray doesn't have a $ infront of it.

Posted: Sat Apr 17, 2004 12:25 am
by bimo
Like I said, stupid. I could've sworn that it was there when I checked... Thanks.

h