Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get day from date

$timestamp = strtotime('2009-10-22');

$day = date('D', $timestamp);
var_dump($day);
Comment

get day by date in php

You can use the date function. I'm using strtotime to get the timestamp to that day ; there are other solutions, like mktime, for instance.

For instance, with the 'D' modifier, for the textual representation in three letters :

$timestamp = strtotime('2009-10-22');

$day = date('D', $timestamp);
var_dump($day);
You will get :

string 'Thu' (length=3)
And with the 'l' modifier, for the full textual representation :

$day = date('l', $timestamp);
var_dump($day);
You get :

string 'Thursday' (length=8)
Or the 'w' modifier, to get to number of the day (0 to 6, 0 being sunday, and 6 being saturday) :

$day = date('w', $timestamp);
var_dump($day);
You'll obtain :

string '4' (length=1)
Comment

get day from date php

// Prints the day
echo date("l") . "<br>";
Comment

get current day php

echo date('l'); // output: current day.
Comment

PREVIOUS NEXT
Code Example
Php :: php artisan route list does not show all my routes 
Php :: how to get woocommerce order details 
Php :: shortcode in wp 
Php :: laravel mail send to multiple recipients 
Php :: change the method name in resource in laravel 
Php :: php check if all values in array are equal 
Php :: what does defined do in php 
Php :: wp_list_custom_post type 
Php :: format a date sting php 
Php :: wp order archive page post by title 
Php :: php string search in array 
Php :: php get char from string position 
Php :: Access-Control-Allow-Origin php laravel 
Php :: php multiple variables assign same value 
Php :: update values in array in php 
Php :: remove last comma from string php foreach 
Php :: stripslashes 
Php :: laravel eloquent multiple join with where conditions 
Php :: php explode end 
Php :: php domdocument list all elements 
Php :: joomla get group id 
Php :: php check image size before upload 
Php :: throw 403 laravel 
Php :: phpexcel set row height 
Php :: python to php 
Php :: Creating Laravel and Vue Project 
Php :: php != operator 
Php :: create table laravel 
Php :: Remove class from body tag in wordpress 
Php :: find php ini 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =