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>
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>
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.