我无法在php $_SESSION['username']
中为echo
着色。
echo "Welcome, " .$_SESSION['username']."! "; //this code is running
echo '<span style="color:#AFA;text-align:center;">Welcome,'$_SESSION['username'];'</span>'; // this part is not working...
如果可以,请帮助我
答案 0 :(得分:4)
您忘记了连结.
。
echo '<span style="color:#AFA;text-align:center;">Welcome,' . $_SESSION['username'] . '</span>'; // this part is not working...
答案 1 :(得分:1)
请注意.
$_SESSION['username'];
echo'<span style="color:#AFA;text-align:center;">Welcome,'.$_SESSION['username'].'</span>';