Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a PHP script to implement a function which will display the current date.

ID: 3658243 • Letter: W

Question

Write a PHP script to implement a function which will display the current date. Also, have the script print out a message stating how many days it is until your birthday. You can "hardcode" your birthdate into the script and have the script calculate the number of days until your birthday any way that you wish Create a Microsoft Word document that contains a screensnap of your script running in a browser.

Explanation / Answer

PHP has the ability to dynamically generate the time and date. Using a simple line of code we are able to include this on our site, however it is important to know how the formatting works. The above code outputs a long string of numbers. What these numbers represent is the time based in the amount of seconds that have passed since January 1 1970 00:00:00 GMT. This number can also be assigned to a variable: Although this is a handy feature, sometimes you want a more formatted and human friendly representation of the date. You can use the date function in conjunction with the time function to display this in the format of date ( format , time ) In our case we want the start time to be now, so we will call the time first. We will demonstrate many different types of formatting When you run this code you will see that the information is formatted in many different ways. What each of the letters means for formatting is explained on the next page.
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote