Echoing session variables in php

This question already has an answer here:

  • Reference - What does this error mean in PHP? 30 answers

  • Inside a double-quoted string you must enclose a complex variable (array or object property) in {} :

    <p><?php echo("{$_SESSION['test']}"."<br />");?></p>
    

    This isn't an issue with $_SESSION specifically, but any array accessed by quoted keys. Note, that you can include a numerically indexed array value with wrapping in {} , as in "echo $array[2] is two";

    链接地址: http://www.djcxy.com/p/69396.html

    上一篇: PHP:致命错误:调用非成员函数

    下一篇: 在php中回显会话变量