i have been getting the error

Parse error: syntax error, unexpected '.', expecting T_VARIABLE or '$'

and the line that has the issue is $ . $

foreach ($fields as &$value) {
$ . $value = $myrow[$value];
}

all im trying to do is make a variable with the for each value. can some one show me the correct way of doing something like that

thanks in advance

Recommended Answers

All 2 Replies

foreach ($fields as &$value) {
${$value} = $myrow[$value];
}

cool that works thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.