Warning I'm a total newbie at both php and any type of coding at all. I was hoping someone could explain a line of code in a for loop for a php/mysql tutorial that I I've been trying to do. The following is the loop:
My guess is this formats the output and calls the variables that will display in the echo $rString."&"; I guess what I don't understand is partially syntax related. I understand that the stuff with $ in it are variables and the stuff in the [ ] refers to items in the array but I don't understand what the stuff with the ampersand is doing. Also why does the = sign have to be in quotes? Thanks.
Wow, that lines a bit of a mouthful isn't it, you could do with breaking it down if you're struggling
// &ID1 = x $rString.= "&ID".$i."=".$row['ID'];
// &visitor1 = x $rString.= "&visitor".$i."=".$row['visitor'];
// &time1 = x $rString.= "&time".$i."=".$row['time'];
// &comment1 = x $rString.= "&comment".$i."=".$row['comment'];
The ampersand (&) is a variable separator, generally used in querystring's (url) or for loading into another language such as flash.
How is $rString being used, in terms of where else is it called in the script?
Regarding the equal sign (=), $rString is being used to concatenate different variables into one string, the full output would look something like: