php参数化SQL查询特殊运算符

php参数化SQL查询特殊运算符,php,sql,operators,sql-injection,parameterized-query,Php,Sql,Operators,Sql Injection,Parameterized Query,我碰巧看到了以下组成参数化SQL查询的方法: function select_user($uid) { // what is '<<<'? // I can't google any document about it // (or I don't know how to search symbol) $sqlStr = <<< SQL_STR SELECT * FROM user WHERE uid

我碰巧看到了以下组成参数化SQL查询的方法:

function select_user($uid)
{
    // what is '<<<'?  
    // I can't google any document about it
    // (or I don't know how to search symbol)

    $sqlStr = <<< SQL_STR

         SELECT * FROM user WHERE uid = ?

SQL_STR; // must put in the begin of the line
         // and it must match the word at the right hand side of '= <<<'

    // Code Igniter Database Class
    return $this->db->query($sqlStr, array($uid));
}
函数选择用户($uid)
{

//你要找的东西叫什么

无论如何,SQL查询与字符串赋值无关:

$html = <<<HTML
    Imagine some HTML here with interspersed $variables
HTML;

$html=使用herdeoc定义字符串,这通常是因为与字符串文字不同,它不必在整个字符串中转义引号

从:

Heredoc文本的行为类似于双引号字符串,没有双引号。这意味着不需要对Heredoc中的引号进行转义,但仍然可以使用上面列出的转义码。变量已展开,但在Heredoc中表达复杂变量时,必须像使用字符串一样小心

$str=
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;