开发者

Storing links in a session?

I want to store links in a session or multiple sessions and I was wondering what would be the best way to do this..

I 开发者_开发百科was thinking that I could use a for loop with sessions foreach session as $s .... But then I would need $session1, $session2, $session3, etc.

Thanks in advance,

--I'm a PHP noob.


You can store arrays in sessions:

$_SESSION['links'] = array('example.com', 'example2.com');

foreach ($_SESSION['links'] as $link) {
  // Do something with $link
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜