Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function show_fruit($timestamp) {
- if($timestamp >= strtotime("-12 hours")) {
- return 'images/lime.png';
- } else if($timestamp >= strtotime("-24 hours")) {
- return 'images/lemon.png';
- } else if($timestamp >= strtotime("-38 hours")) {
- return 'images/pom.png';
- } else {
- // the final one if it doesn't suit the others
- return 'images/strawberry.png';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement