Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试过这个:
$_SESSION['fullname'] = $_SESSION['firstname'] + $_SESSION['surname']; echo $_SESSION['fullname'];
但它不起作用:-(
你可能的意思是:
$_SESSION['fullname'] = $_SESSION['firstname'] . $_SESSION['surname']; // ^
要连接字符串,您应该使用.not +。
.
+
要组合字符串,请使用“。” 而不是 "+" $_SESSION['fullname'] = $_SESSION['firstname'] 。$_SESSION['姓氏'];