$i = 1
echo '
<p class="paragraph$i">
</p>
'
++i
Trying to insert a variable into an echoed string. The above code doesn't work. How do I iterate a php variable into an echo string?
|
Single quotes will not parse PHP variables inside of them. Either use double quotes or use a dot to extend the echo.
OR
And in your case:
OR
|
|||||||||
|
Variable interpolation does not happen in single quotes. You need to use double quotes as:
|
|||
|