Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tips How get one week date using PHP
#1
This is a short guide on how to get the date of the week from a monday to sunday in PHP. This is useful for whenever you need to figure out what date a particular date fell on (or will fall on in the future). In this tutorial, I will be retrieving the date from a YYYY-MM-DD string.
Example

PHP Code:
$data ['monday'   date'Y-m-d'strtotime('monday this week'));
$data ['tuesday'  date'Y-m-d'strtotime('tuesday this week'));
$data ['wednesday'] = date'Y-m-d'strtotime('wednesday this week'));
$data ['thursday' date'Y-m-d'strtotime('thursday this week'));
$data ['friday'   date'Y-m-d'strtotime('friday this week'));
$data ['saturday' date'Y-m-d'strtotime('saturday this week'));
$data ['sunday'   date'Y-m-d'strtotime('sunday this week')); 

To Purchase Credit Click here , For how to make money on Sologet forum Click here . 
There is love in sharing
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  How to Stop Sending E-Mail Spam using PHP mail function Kingsolomon 1 59 11-12-2018, 04:38 PM
Last Post: Solomon
  Multiple file upload in php Kingsolomon 1 67 11-08-2018, 03:01 PM
Last Post: Solomon
  How to limit text length in php and provide 'Read more' link Kingsolomon 0 48 10-31-2018, 02:08 PM
Last Post: Kingsolomon
  How to read more / hide text using Jquery and PHP Kingsolomon 0 40 10-31-2018, 02:06 PM
Last Post: Kingsolomon
  Download simple HTML email templates Kingsolomon 0 43 10-31-2018, 02:05 PM
Last Post: Kingsolomon

Forum Jump:


Users browsing this thread:
1 Guest(s)

How get one week date using PHP00