Gar*_*orn 8 css php string brackets heredoc
给出以下代码:
$myString = <<<script
.
.
.
script;
Run Code Online (Sandbox Code Playgroud)
感谢这个问题的原始版本的答案,我理解<<<是heredoc语法,被视为双引号而不需要转义引号.
更进一步,这是如何最好地利用?具体来说,这是否应该减轻处理包含代码语法的混合引用字符串的压力?
I,E ..
attribute="name-like string" attribute="property: 'value("value")';"
Run Code Online (Sandbox Code Playgroud)
想到这可能是有用的(如果以我现在猜测的方式实现),特别是在处理更大的复杂性和/或寻找代码注入时.再次,寻找heredoc特别有用或可利用的任何场景.
这是Heredoc语法:http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
它最大的优点是你不必担心转义引号,因为字符串不是引号分隔的.
归档时间: |
|
查看次数: |
4127 次 |
最近记录: |