Created
September 25, 2014 14:29
-
-
Save elkarrde/dd098d18b6fa747f84b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('phpCounter.php'); | |
?> | |
<html> | |
<head> | |
<title>phpCounter example</title> | |
</head> | |
<body> | |
<h1>Hi!</h1> | |
<p> | |
I was seen great many times! Exactly this much: <?=counter();?>! | |
</p> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* phpCounter v.0.0.1 by Neven Falica (elkarrde@github/twitter) */ | |
function counter() { | |
$counter_file = 'counter.data'; | |
$counter = file_get_contents($counter_file); | |
file_put_contents($counter_file, ++$counter); | |
return $counter; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment