开发者

Assign Array Of Objects To Session

开发者 https://www.devze.com 2023-02-17 17:32 出处:网络
I got the following: $_SESSION[\"content\"] = $contentList->Value; 开发者_如何学CWhere it assigns an array of objects to the session variable... When I then try to access the array it return 60

I got the following:

$_SESSION["content"] = $contentList->Value;
开发者_如何学C

Where it assigns an array of objects to the session variable... When I then try to access the array it return 60 elements for example that are the size of the array but the objects in the array are blank... None of the properties in them are set.

Try to access:

$contentList = $_SESSION["content"];
foreach($contentList as $currentContent)
{
    //......
}


Make sure you have included the classe definition before invoking sesssion_start()

0

精彩评论

暂无评论...
验证码 换一张
取 消