Ik wil bovenstaande functie gebruiken zoals in het volgend stukje code :

<?php>
$maand=$post['maand'];


$jaar=$post['jaar'];
$isLeap = mcal_is_leap_year($jaar);
echo $jaar;
echo $maand;
$aantaldagen= mcal_days_in_month ($maand, $isleap);
?>

Ik krijg echter de melding : Call to undefined function mcal_is_leap_year()

Zijn dit bijzondere functies die je eerst nog ergens moet activeren o.i.d. ???

Let wel ..ik ben een absolute beginneling in de wondere wereld van php
klik voor de gein eens op de functie in je script of had hem even zelf opgezocht op php.net:


Note: This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 5.0.0.

This extension requires the mcal library to be installed. Grab the latest version from » http://mcal.chek.com/ and compile and install it.
Ik zag het al meteen staan PHP 4 dus :P GEEN 5!
Bedankt voor de snelle reactie. Ik heb informatie over de functie wel opgezocht maar had niet door dat in nieuwere versies, functies konden verdwijnen. Ik ging er van uit dat als het in 4 zit, het ook wel in 5 zal zitten , dus niet.

Heb de mcal library inmiddels gedownload, nu nog uitzoeken hoe ik dit moet toepassen. Dus als je nog een informatief linkje hebt ... heel graag.

Zoek zelf ook verder
In de toelichting staat ook :
This extension is not available on Windows platforms

Gaat dus niet lukken ben ik bang, iemand nog een goede tip ????
Met deze functie ( stond gewoon op PHP.net )

<?
function Gr_IsLeapYr ($yr) {
$isleap=0;
if ($yr % 4 == 0) {
// Years evenly divisible by 4 are leap years.
$isleap=1;
// Exception: Centurial years that are not evenly divisible by 400.
if ( $yr % 100 == 0 && $yr % 400 != 0) {
// not a leap year
$isleap=0;
}
}
return $isleap;
} // end Gr_IsLeapYear

?>
Ik heb het inmiddels als volgt opgelost :

$begindatum= mktime(0,0,0,$maand,1,$jaar);
$einddatum= mktime(0,0,0,$maand+1,0,$jaar);

In ieder geval bedankt voor jullie reacties

Reageren