Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End FOR loop with counter in variables Re: FOR loop with counter in variables

#135778
__
Participant

> I think the whole confusion is rooted in the way quotes have to be used. It sure confused me

Remember, single-quotes ( `’` ) make literal strings – every character you type ( except “, but let’s not get into that right now) will be exactly as you see it.

With double-quotes ( `”` ) , PHP will interpret variables and escape characters in the string. So,

$var = ‘world’;
echo ‘Hello, $var’; # prints “Hello, $var”
echo “Hello, $var”; #prints “Hello, world”