gpt4 book ai didi

php - session php语句

转载 作者:行者123 更新时间:2023-12-02 05:27:15 25 4
gpt4 key购买 nike

我如何将其命令到一个语句中,该语句将所有 $_POST[] 放入一个 session 中,而不必写出每一行。

<?php session_start(); 
$_SESSION['s_type'] = $_POST['s_type'];
$_SESSION['s_uname'] = $_POST['s_uname'];
$_SESSION['s_email'] = $_POST['s_email'];
$_SESSION['s_promo'] = $_POST['s_promo'];
$_SESSION['s_ctry'] = $_POST['s_ctry'];
?>

最佳答案

$_SESSION['POST'] = $_POST;
echo $_SESSION['POST']['s_type'];

关于php - session php语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7879251/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com