Come in with PHP. & lt ;? Phpif ($ downhits2) {echo & nbsp; & lt; div & nbsp; & gt; & nbsp; & nbsp; {loop & PHP understanding
If ($ downhits = 2)
{
Echo'
{Loop $ downfile $ r}
{$ R}
{/Loop}
{Loop $ downfiles $ r}
{$ R}
{/Loop}
';
}
Else
{
Echo'
{Loop $ downfile $ r}
{$ R}
{/Loop}
{Loop $ downfiles $ r}
{$ R}
{/Loop}
';}
?>
The above code is output in echo, but this $ r and $ downfiles do not seem to respond, so I would like to ask how to output $ r and $ downfiles in echo, or how to call or use the syntax. right
Share :?????????? {Loo... 'data-pics = ''>
------ Solution --------------------
First, variables in single quotes in PHP cannot be parsed as variable values.
So replace your echo 'xxxxxxxxxxxxxxxxxx' with echo "xxxxxxxxxxx" (and replace the internal double quotation marks with single quotation marks)
Secondly, I don't understand the environment in which such a statement is used. can it be a normal loop? the above method is only for the problem that the two variables you asked cannot be parsed.
------ Solution --------------------
I do not understand php, but I know that variables are not included in single quotes. I only use the variable name as a string.
------ Solution --------------------
The loop tag is a custom template loop tag of PHPcms. here, echo outputs the string to the template. the variable $ downfiles is allocated to the controller file corresponding to the template, loop then outputs the variable cyclically. $ downfiles is the value in the array $ r.
------ Solution --------------------
If ($ downhits = 2)
{
Echo'
';
{Loop $ downfile $ r}