A new type of PHP string for a sad reminder
PHP Manual introduces the so-called new string, I thought it is still very useful, otherwise for a large paragraph of HTML light escaped quotation mark single quotation marks the trouble to die, today I just use it, the results of sad to find that I was not the spirit.
$str = << < pre=""> is such a simple paragraph, Terminator mark; shelf placed, check in PHPEclipse no errors, but run the time is not, reported the following errorParse error:syntax error, unexpected ' << ' (T_SL) in .....
Google a little, found that the problem is a lot of people, the answer is Terminator shelf placement, I this absolutely conforms to the standard Ah, is my PHP version not? ...... After Daoteng a few, I found my start character "<<
<>< p=""><>
So, the rules for this new type of PHP string are:
1, start the symbol, with three less than sign the name of the symbol, such as: "<<
<>< p=""><>
2, Technical symbols ("EOT;" ) must be shelf placed. In addition, this semicolon can not have a space after the same!!! Believe me, I've tried. My version is PHP 5.3.2, PHP 5.4.4, other versions have not been tried.