Create a php script that will display your birth month
PHP date [28 exercises with solution]1. Write a PHP script which will display the copyright information in the following format. To get current year you can use the date()
function. Go to the editor Show 2. Create a simple 'birthday countdown' script, the script will count the number of days between current day and birthday.
Go to the editor 3. Write a PHP script to print the current date in the following format. To get current date's information you can use the date()
function. Go to the editor 4. Write a PHP script to calculate the difference between two
dates. Go to the editor 5. Write a PHP script to convert a date from yyyy-mm-dd to dd-mm-yyyy.
Go to the editor 6. Write a PHP script to convert the date to timestamp. Go to
the editor Click me to see the solution 7. Write a PHP script to calculate a number of days between two dates. Go to the editor 8. Write a PHP script to get the first and last day of a month from a specified date. Go to the editor 9. Write a PHP script to print like : Saturday the 7th. Go to the editor 10. Write a PHP script to check whether the given dates are valid or not?
Go to the editor 11. Write a PHP script to get time difference in days and years, months, days, hours, minutes, seconds between two dates. Go to
the editor 12. Write a PHP script to change month number to month name. Go to the editor 13. Write a PHP script to get yesterday's date. Go to the editor 14. Write a PHP script to get the current date/time of 'Australia/Melbourne'.
Go to the editor 15. Write a PHP script to check whether a date is a weekend or not. Go to the editor 16. Write a PHP script to add/subtract the number of days from a particular date. Go to the editor 17. Write a PHP function to get start and end date of a week (by week number) of a particular year. Go to the editor 18. Write a PHP script to calculate the current age of a person. Go to the editor 19. Write a PHP script to calculate weeks between two dates. Go to the editor 20. Write a PHP script to get the number of the month before the current month. Go to the editor 21. Write a PHP script to convert seconds into days, hours, minutes and seconds. Go to the editor 22. Write a PHP script to get the last 6 months from the current month.
Go to the editor 23. Write a PHP script to get the current month and previous three months. Go to the editor 24. Write a PHP script to increment date by one month Go to the editor 25. Write a PHP script to get the current date in Italian. Go to the editor 26. Write a PHP script to convert the number to month name.
Go to the editor 27. Write a PHP script to get the number of days of the current month. Go to the editor 28. Write a PHP script to display time in a specified timezone. Go to the editor PHP Code Editor: More to Come ! Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page. PHP: Tips of the DayPHP: Showing all errors and warnings Display errors could be turned off in the php.ini or your Apache configuration file. You can turn it on in the script: error_reporting(E_ALL); ini_set('display_errors', 1); You should see the same messages in the PHP error log. Ref : https://bit.ly/34di0ji How to get date of birth in php?“php birth date” Code Answer's
Simple method for calculating Age from dob: $_age = floor((time() - strtotime('1986-09-16')) / 31556926); 31556926 is the number of seconds in a year.
How to convert age to date of birth in php?php $bday = new DateTime('11.4. 1987'); // Your date of birth $today = new Datetime(date('m.d.y')); $diff = $today->diff($bday); printf(' Your age : %d years, %d month, %d days', $diff->y, $diff->m, $diff->d); printf("\n"); ?>
|