I am trying to get sessionStorage data to a php string variable. Then from there I am trying to convert it to a php array of objects. My target is to save stored data in sessionStorage to a mysql database. Following is the process I am following.
$jsonString = "<script>document.write(sessionStorage['sca'])</script>";
$arr = json_decode($jsonString );
var_dump($arr );
print_r($arr);
The Output I am getting is NULL
What I want is the following
Array ( [0] => stdClass
Object ( [name] => iphone [s] => black [price] => 50000 [id] => 2 [qty] => 3 )
[1] => stdClass
Object ( [name] => iphone [s] => black [price] => 50000 [id] => 2 [qty] => 3 )
)
Can't figure what I am doing wrong