Reputation: 16793
What am I doing wrong here to get undefined variable notice.
if (isset(${$error_description_.$i}[$lang])) {
Previously I had this:
if (isset($error_description_1[$lang])) {
I now have this inside a for loop where 1 is replaced.
Upvotes: 1
Views: 61
Reputation: 61
This should work:
if (isset(${'error_description_' . $i}[$lang])) {
}
Upvotes: 0
Reputation: 4021
It should be:
if (isset(${"error_description_".$i}[$lang])) {
Upvotes: 2