Hi,

The function cal_days_in_month(). is not working in php 4.3.1. why did its giving

Fatal error: Call to undefined function: cal_days_in_month() in /var/www/html/marketagenda/index.php on line 4

any alternative for this function.

sharma

    go to www.php.net/date and look thru the user comments, someone made a function to do just that...

    and the only way "calendar" functions will work is if PHP is compiled with --calendar

      I did it and the function provided by one of the users is using. But why the function is not working?. any specific issues or limitations with versions.

      Thanks,
      sharma

        Originally posted by phpsharma
        I did it and the function provided by one of the users is using. But why the function is not working?. any specific issues or limitations with versions.

        Thanks,
        sharma

        not that i'm aware of... how is it not working?

          are you feeding the script the month somehow? like you know what month you are looking for?

          if so... just use an array...

          <?
          $month = $_GET['month'];
          $year = $_GET['year'];
          
          // Find out how many days there are in the month. Factor in leap year.
          if ($year%4 == 0)
          {
          	$daysInMonth = array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
          }
          else
          {
          	$daysInMonth = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
          }
          ?>
          
            Write a Reply...