This will double quote immediately"/> This will double quote immediately">

Home >Backend Development >PHP Tutorial >How to use QQ Tornado offline download PHP error using variables in quotation marks

How to use QQ Tornado offline download PHP error using variables in quotation marks

WBOY
WBOYOriginal
2016-07-29 08:39:50901browse

When you see the error message
syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
this message is about the use of variables.
What happened to me was that an array was used in the statement, causing it to fail. Let's take a look at the failed code;
echo "I am an array, $n['x']";
?>
In this way, the variable can be parsed by instant double quotes, but the writing method of the element group is like this There is no way to parse it. Just modify it to the following!
echo "I am an array, {$n['x']}";
?>
Adding curly brackets {} can make the statement recognize that it is dynamic.

The above introduces how to use qq tornado offline download PHP error in using variables in quotation marks, including how to use qq tornado offline download. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn