dqfxao2898 2017-05-30 12:14
浏览 718
已采纳

我可以使用php从localstorage获取数据吗?

Can I get data from localstorage using php if yes then tell me how in localstorage data set like this

<script>
var i=0;
function inc()
{
    i+=1;
    localStorage.setItem("qnum", i);
}
</script>
  • 写回答

3条回答 默认 最新

  • drelgkxl93433 2017-05-30 12:15
    关注

    No, you can't. PHP runs on your server, the LocalStorage is on the client. The only way is to read the LocalStorage via JavaScript, and send the result to your server via ajax.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?