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
}
精彩评论