Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get all weeks in month php

<?php 		

$textdt="01 june 2011";
$dt= strtotime( $textdt);
$currdt=$dt;
$nextmonth=strtotime($textdt."+1 month");
$i=0;

do 
{
    $weekday= date("w",$currdt);
    $nextday=7-$weekday;
    $endday=abs($weekday-6);
    $startarr[$i]=$currdt;
    $endarr[$i]=strtotime(date("Y-m-d",$currdt)."+$endday day");
    $currdt=strtotime(date("Y-m-d",$endarr[$i])."+1 day");

    echo "Week ".($i+1). "-> start date = ". date("Y-m-d",$startarr[$i])." end date = ". date("Y-m-d",$endarr[$i])."<br>";
     $i++;
 	  		     
}while($endarr[$i-1]<$nextmonth);



?>
Comment

PREVIOUS NEXT
Code Example
Php :: pagination php 
Php :: php class comment 
Php :: php forech pdo 
Php :: active class php 
Php :: tackel discount in javascript 
Php :: how to validate phone number in php procedural programming 
Java :: how to make phone vibrate android studio 
Java :: androidx recyclerview dependency 
Java :: round jframe corners in java 
Java :: java swing make window not resizable 
Java :: save map to file java 
Java :: read text file java to string 
Java :: java android show toast 
Java :: handler delay android 
Java :: java jcombobox get selected item 
Java :: remove double quote java 
Java :: processing string to int 
Java :: toast java example 
Java :: exit app android 
Java :: array to map java10 
Java :: spigot scheduler 
Java :: spring load config value in variable 
Java :: how to check type of primitive value in java 
Java :: printwriter java append to file 
Java :: install java with brew 
Java :: java import decimalformat 
Java :: round bg android 
Java :: how to constraint layout parm programmatically in android 
Java :: java get specific element from arraylisb 
Java :: how to open activity in android studio 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =