Skip to content

Instantly share code, notes, and snippets.

@wickywills
Last active September 12, 2018 12:38
Show Gist options
  • Save wickywills/a441b2ff192e7f153fe9519d237b6b47 to your computer and use it in GitHub Desktop.
Save wickywills/a441b2ff192e7f153fe9519d237b6b47 to your computer and use it in GitHub Desktop.
```php
session_start();
if (!isset($_SESSION['views'])) {
$_SESSION['views'] = 0;
}
$_SESSION['views'] = $_SESSION['views']+1;
if ($_SESSION['views'] == 1) {
// Do something
}
if ($_SESSION['views'] == 2) {
// Do something else
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment