Given the following PHP code: 1. Şedt="2020-11-30"; // sale end date 2. $cdts=time(; // current timestamp Click and Drag the following PHP segments to reorder them and complete the above code to calculate the number of days remaining for the sale end date given above. The # of days is to be sent to the Web Browser?

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter5: Working With Multiple Worksheets And Workbooks
Section: Chapter Questions
Problem 4AYK
icon
Related questions
Question
Given the following PHP code:
1. $edt="2020-11-30"; // sale end date
2. $cdts=time();
// current timestamp
Click and Drag the following PHP segments to reorder them and complete
the above code to calculate the number of days remaining for
the sale end date given above. The # of days is to be sent to the Web Browser?
$days= floor(($edts-$cdts)/86400);
echo "Sale will end on $edt after $days days";
list($ey, $em, $ed)=explode('-', $edt);
$edts=mktime(0,0,0,$em,$ed, $ey);
Transcribed Image Text:Given the following PHP code: 1. $edt="2020-11-30"; // sale end date 2. $cdts=time(); // current timestamp Click and Drag the following PHP segments to reorder them and complete the above code to calculate the number of days remaining for the sale end date given above. The # of days is to be sent to the Web Browser? $days= floor(($edts-$cdts)/86400); echo "Sale will end on $edt after $days days"; list($ey, $em, $ed)=explode('-', $edt); $edts=mktime(0,0,0,$em,$ed, $ey);
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L