|
Follow @phpsnips |
<form action="" method="GET">
<input type="text" name="theYear" placeholder="insert your year right here">
<input type="submit">
</form>
<?php
//this programs check the day of my birday any year I enter in the text box :)
echo '<br/>';
echo 'You entered '.$_GET['theYear'];
echo '<br/>';
echo '<br/>';
// specify the date of your interest and put it in variable;
$birthdaySeconds = mktime(0, 0, 0, 6, 24, $_GET['theYear']);
// get the timestamp of your date into the getdate array
$birthdayGetDate = getdate($birthdaySeconds);
// now obtain the value of the key you want;
echo 'My birthday next year is on '.$birthdayGetDate['weekday'].'<br/>';
?>
|
Rate this Snippet: |
Suggested Difficulty Level: No votes yet.
Current Score: No votes yet
Total Views: 560
Other top snippets by maque:
1. Read file or site in a string
2. If else
3. Types of loops (for, foreach, while)
4. contact form with basic protection
5. put links on homepage only
1. Automatic Color Correction (4.50 of 2)
2. Image to ASCII (4.33 of 3)
3. String Output Formatter (1.00 of 1)
4. IP Blacklist Check (5.00 of 11)
5. Send SMS with (3.60 of 5)
6. Cache PHP Generated (0.00 of 0)
7. Database Connection (4.00 of 2)
8. Email Validator (3.25 of 4)
9. Shorten text and (3.67 of 3)
10. file-based simple guest (2.00 of 1)
11. adding an entry (5.00 of 1)
12. integer to currency (1.33 of 3)
13. Aggregate IP addresses (0.00 of 0)
14. file handling (0.00 of 0)
15. testing system with (0.00 of 0)
16. Make an php (1.00 of 1)
17. allow download in (5.00 of 1)
18. redirect in 3 (3.00 of 2)
19. live clock with (1.00 of 1)
20. visit counter (4.00 of 3)
21. contact form with (3.33 of 3)
22. show a specific (1.00 of 1)
23. The & sign (5.00 of 1)
24. static variable in (1.00 of 1)
25. multiplication table with (1.00 of 1)