this is the kind of problem which really wants to make me smash my powerbook on the wall.
so, I have created an array by means of multiple checkboxes. I know it's a valid array because print_r() returns something like:
Array ( [0] => 1 [1] => 2 [2] => 6 [3] => 17 )
so now I simply want to loop through the array and display the values. that should be easy enough using following code:
// create array
$a = array(1, 2, 6, 17);
// loop through array
foreach ($a as $v) {
echo 'Current value of '.$a.': '.$v.'';
}
BUT IT DOES NOT WORK!!!!
I keep getting a parse error along the lines of:
Parse error: syntax error, unexpected T_ECHO in /home/.ivanhoe/localprojects/localprojects.net/db/projects.php on line 138
where line 138 would be: echo 'Current value of '.$a.': '.$v.'';
I've dumbed down the code to a minimum, well, actually I've copypasted above code from php.net. my php installation is 4.4.2, so that shouldn't be the problem.
Someone got a hint where the error might be? or is it something obvious and I'm just plain stupid?