We're on theHowever, it is necessary to add a variable description to the PHP string, although there is no error in the following example:
- Php
- $ Temp Array("one" => 1, "one" => 2);
- Output:: The first element is 1
- echo "The first element is $temp [one].";
- ?>
However, if there is no double quotation mark in the back of the Echo statement, it is necessary to give an error, so we recommend using curly braces:
- Php
- $ Temp Array("one" => 1, "one" => 2);
- echo "The first element is {$temp [" one "]}.";
- ?>
These are the specific workarounds for adding variables to the PHP string.
http://www.bkjia.com/PHPjc/446370.html www.bkjia.com true http://www.bkjia.com/PHPjc/446370.html techarticle we are right but need to add a variable to the PHP string description, although the following example is not error:? php $ temp = Array ("One" = 1, "two" = 2);//output:: Thefirstelementis1 ...