douyangcheng4965 2017-11-17 07:57
浏览 53
已采纳

在已存在的会话数组中存储一组文件

i have a session array called $_SESSION['CART'] i already use it to store details of cart items now i want to store multiple uploaded files names of files that user uploads while adding this item to cart as part of the session cart.i want to store them with key files. this is what am doing but its not working. is there a way for me to achieve this

$_SESSION['cart'][] = 
    array(
            'id'=>$productid, 
            'quantity'=>$quantity, 
            'detail'=>$detail, 
            'files'=>$files
    );
  • 写回答

2条回答 默认 最新

  • dongtan9066 2017-11-17 08:16
    关注

    Nothing much to explain here. if you want to store multiple array inside of array to store multiple file names. I assume that $files is a single file name only. Try this.

    $_SESSION['cart'] = array(
        array(
            'id'=>$productid, 
            'quantity'=>$quantity, 
            'detail'=>$detail, 
            'files'=>$files
        )
    );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 数字信号处理实验报告
  • ¥15 ensp路由器启动不了一直报#
  • ¥50 安卓10如何在没有root权限的情况下设置开机自动启动指定app?
  • ¥15 ats2837 spi2从机的代码
  • ¥200 wsl2 vllm qwen1.5部署问题
  • ¥100 有偿求数字经济对经贸的影响机制的一个数学模型,弄不出来已经快要碎掉了
  • ¥15 数学建模数学建模需要
  • ¥15 已知许多点位,想通过高斯分布来随机选择固定数量的点位怎么改
  • ¥20 nao机器人语音识别问题
  • ¥15 怎么生成确定数目的泊松点过程