A small example of php multi-value cookies

WBOY
Release: 2016-07-25 08:56:20
Original
824 people have browsed it
  1. /**
  2. * Set php multi-value cookies
  3. * by bbs.it-home.org
  4. */
  5. if (!isset ($userdetails [0] ) ) {
  6. setcookie ("userdetails[0]", $username);
  7. }
  8. $ userdetails[1]++;
  9. setcookie ("userdetails[1]", $userdetails[1]);
  10. echo ("Hello $userdetails[0], you have visited this page: ".$userdetails[1]. ($userdetails[1] == l?" time!": "times!"));
  11. ?>
Copy code


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template