Variables are used in PHP error quotation marks. When syntaxerror, unexpectedT_ENCAPSED_AND_WHITESPACE, and expectingT_STRINGorT_VARIABLEorT_NUM_STRING are displayed in the error message, the variable usage is prompted. When I see an error prompt
Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
This prompt indicates the usage of the variable.
What I see is that an array is used in the statement, resulting in a failure. Next let's look at the failed code;
Echo "I am an array, $ n ['x']";
?>
In this way, variables can be resolved in real-time double quotation marks, but such a group cannot be parsed. Modify it to the following!
Echo "I am an array, {$ n ['x']}";
?>
With curly braces {}, the statement can be identified dynamically.
When syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING is a prompt for variable usage. And I appear...