Hi -
I need some syntax help with a FOR or FOREACH statement. I want to reiterate a few lines over several variables that are not numbers (or items, etc.). But i can't seem to get the correct combination of syntax. From the wiki, it looks like a foreach will work, but it errors out on "Aggregate reference expected", and FOR seems to expect a series.
Can anyone point me in the correct direction? Thanks!
I need some syntax help with a FOR or FOREACH statement. I want to reiterate a few lines over several variables that are not numbers (or items, etc.). But i can't seem to get the correct combination of syntax. From the wiki, it looks like a foreach will work, but it errors out on "Aggregate reference expected", and FOR seems to expect a series.
Can anyone point me in the correct direction? Thanks!
PHP:
string var1 = "cat" ;
string var2 = "3dog" ;
string var3 = "bird-232" ;
foreach x in (var1, var2, var3) {
print(x) ;
}