WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search


Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - השוואת מחירים בסופר
ZeroLag.com
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Count Number Of weeks in Month
Categories : PHP, Date Time, Beginner Guides Click here to Update Your Picture
Manoj kumar
Date : Feb 01st 2011
Grade : 4 of 5 (graded 2 times)
Viewed : 7288
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Manoj kumar
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
Like this code?
Show the author your appreciation.
 

<?php
for ($year = 2011; $year <= 2012; $year++){
    for (
$month = 1; $month <= 12; $month++){
       
$num_of_days = date("t", mktime(0,0,0,$month,1,$year));
        echo
"<b>Month=$month Year=$year </b><BR>";
        echo
"Number of days = $num_of_days <BR>";
       
$firstdayname = date("D", mktime(0, 0, 0, $month, 1, $year));
       
$firstday = date("w", mktime(0, 0, 0, $month, 1, $year));
       
$lastday = date("t", mktime(0, 0, 0, $month, 1, $year));
       
$lastdayname = date("D", mktime(0, 0, 0, $month, $lastday, $year));
        echo
"First day of the month = $firstday,$firstdayname <BR> ";
        echo
"Last day of the month = $lastday,$lastdayname <BR> ";
       
$no_of_weeks = 1;
       
$count_weeks = 0;
        while(
$no_of_weeks <= ($lastday+$firstday)){
           
$no_of_weeks += 7;
           
$count_weeks++;
        }
        echo
"Number Of weeks in Month=$month Year=$year = $count_weeks <br>";
    }
}
?>



Find if a year is leap.
Categories : PHP, Date Time, Beginner Guides, Data Validation
Script loading time
Categories : PHP, Beginner Guides, Date Time
Local Time clock and Server time usign PHP and JavaScript
Categories : PHP, Java Script, Date Time, Beginner Guides
How to Insert a Date Format Into MySQL from PHP
Categories : PHP, Databases, MySQL, Date Time, Beginner Guides
Kewl Date Example
Categories : PHP, HTML and PHP, Date Time, CSS, Beginner Guides
Change the background color of a website daily dynamically using the php date function to get the current day of the week and depending on that day, set the background color for the web page.
Categories : PHP, Date Time, Beginner Guides, Web Design
Find the day of the week for any given year/month/day.
Categories : PHP, Date Time, Data Validation, Algorithms, Beginner Guides
a class that uses microtime() to provide easy calculation of elapsed times
Categories : Date Time, PHP, PHP Classes
Simple conversion functions to change MySQL dates to arrays, arrays to MySQL dates.
Categories : PHP, Arrays, Date Time, Databases, MySQL
function to generate calendars on the fly.
Categories : Calendar, PHP, Date Time
Newbie Notes #10 - Generating drop downs
Categories : PHP, MySQL, HTML, Beginner Guides, Databases
Current Page's URL using PHP
Categories : PHP, Beginner Guides, Global Variables
PHP Class to calculate Degrees Minutes Seconds to Decimal Degrees
Categories : PHP, PHP Classes, Geo Related, Beginner Guides
Calendar, Kalender, date, time, day, month, year
Categories : PHP, Date Time, Calendar
Simple Cookie example
Categories : PHP, Beginner Guides, Cookies