PHP – Dates et fêtes en Français

Il y a plusieurs semaines que je n’alimente plus ce blog et c’est bien dommage, mais cela signifie aussi que les affaires fonctionnent pour moi et que je n’ai plus le temps de me consacrer aux tutos et actualités sur le développement web. Mais ce n’est pas pour autant que je dois laisser de coté mes lecteurs et ne plus assurer une veille sur mon propre blog. Pour cette raison, aujourd’hui je vais vous présenter un début de classe PHP que vous pourrez améliorer, modifier et agrémenter.

Cette classe, que l’on nommera pour commencer « ludikcalendar » a pour objectif de Franciser les dates, de nous ressortir les jours et mois en français et de nous donner la fête d’un jour souhaité.

ludikcalendar-php-dates-fr

Bien entendu, il y a pleins de solutions et de méthodes déjà existantes, mais c’est une manière d’utiliser et d’apprendre le fonctionnement de PHP.

Donc voyons un peu cette classe :

[pastacode lang= »php » manual= »%3C%3Fphp%20%0A%2F**%20%0A*%20ludikcalendar%20%0A*%20Classe%20(plugin)%20de%20manipulation%20pour%20%C3%A9l%C3%A9ments%20de%20calendrier%20-%20PHP%205%20oblige%20%0A*%2F%20%0A%0Aclass%20ludikcalendar%7B%20%0A%09%0A%09%2F**%20%0A%09*%20Tableau%20avec%20jour%20dans%20l’ann%C3%A9e%2C%20num%20mois%2C%20num%20jour%2Fmois%20et%20la%20f%C3%AAte%20%0A%09*%20%40var%20array%20%0A%09*%20%40access%20private%20%0A%09*%2F%20%0A%09private%20%24cal_fetes%20%3D%20array(%201%20%3D%26gt%3B%20array(‘1’%2C’1’%2C’Jour%20de%20l%5C’an’)%2C%26lt%3Bbr%20%3F–%3E%202%20%3D%26gt%3B%20array(‘1’%2C’2’%2C’Basile’)%2C%0A%093%20%3D%26gt%3B%20array(‘1’%2C’3’%2C’Genevi%C3%A8ve’)%2C%0A%094%20%3D%26gt%3B%20array(‘1’%2C’4’%2C’Odilon’)%2C%0A%095%20%3D%26gt%3B%20array(‘1’%2C’5’%2C’Edouard’)%2C%0A%096%20%3D%26gt%3B%20array(‘1’%2C’6’%2C’M%C3%A9laine’)%2C%0A%097%20%3D%26gt%3B%20array(‘1’%2C’7’%2C’Raymond’)%2C%0A%098%20%3D%26gt%3B%20array(‘1’%2C’8’%2C’Lucien’)%2C%0A%099%20%3D%26gt%3B%20array(‘1’%2C’9’%2C’Alix’)%2C%0A%0910%20%3D%26gt%3B%20array(‘1’%2C’10’%2C’Guillaume’)%2C%0A%0911%20%3D%26gt%3B%20array(‘1’%2C’11’%2C’Pauline’)%2C%0A%0912%20%3D%26gt%3B%20array(‘1’%2C’12’%2C’Tatiana’)%2C%0A%0913%20%3D%26gt%3B%20array(‘1’%2C’13’%2C’Yvette’)%2C%0A%0914%20%3D%26gt%3B%20array(‘1’%2C’14’%2C’Nina’)%2C%0A%0915%20%3D%26gt%3B%20array(‘1’%2C’15’%2C’R%C3%A9mi’)%2C%0A%0916%20%3D%26gt%3B%20array(‘1’%2C’16’%2C’Marcel’)%2C%0A%0917%20%3D%26gt%3B%20array(‘1’%2C’17’%2C’Roseline’)%2C%0A%0918%20%3D%26gt%3B%20array(‘1’%2C’18’%2C’Prisca’)%2C%0A%0919%20%3D%26gt%3B%20array(‘1’%2C’19’%2C’Marius’)%2C%0A%0920%20%3D%26gt%3B%20array(‘1’%2C’20’%2C’S%C3%A9bastien’)%2C%0A%0921%20%3D%26gt%3B%20array(‘1’%2C’21’%2C’Agn%C3%A8s’)%2C%0A%0922%20%3D%26gt%3B%20array(‘1’%2C’22’%2C’Vincent’)%2C%0A%0923%20%3D%26gt%3B%20array(‘1’%2C’23’%2C’Banard’)%2C%0A%0924%20%3D%26gt%3B%20array(‘1’%2C’24’%2C’Fran%C3%A7ois%20de%20Sales’)%2C%0A%0925%20%3D%26gt%3B%20array(‘1’%2C’25’%2C’Conversion%20de%20Paul’)%2C%0A%0926%20%3D%26gt%3B%20array(‘1’%2C’26’%2C’Paule’)%2C%0A%0927%20%3D%26gt%3B%20array(‘1’%2C’27’%2C’Ang%C3%A8le’)%2C%0A%0928%20%3D%26gt%3B%20array(‘1’%2C’28’%2C’Thomas%20d%5C’Aquin’)%2C%0A%0929%20%3D%26gt%3B%20array(‘1’%2C’29’%2C’Gildas’)%2C%0A%0930%20%3D%26gt%3B%20array(‘1’%2C’30’%2C’Martine’)%2C%0A%0931%20%3D%26gt%3B%20array(‘1’%2C’31’%2C’Marcelle’)%2C%0A%0932%20%3D%26gt%3B%20array(‘2’%2C’1’%2C’Ella’)%2C%0A%0933%20%3D%26gt%3B%20array(‘2’%2C’2’%2C’Chandeleur’)%2C%0A%0934%20%3D%26gt%3B%20array(‘2’%2C’3’%2C’Blaise’)%2C%0A%0935%20%3D%26gt%3B%20array(‘2’%2C’4’%2C’V%C3%A9ronique’)%2C%0A%0936%20%3D%26gt%3B%20array(‘2’%2C’5’%2C’Agathe’)%2C%0A%0937%20%3D%26gt%3B%20array(‘2’%2C’6’%2C’Gaston’)%2C%0A%0938%20%3D%26gt%3B%20array(‘2’%2C’7’%2C’Eug%C3%A8nie’)%2C%0A%0939%20%3D%26gt%3B%20array(‘2’%2C’8’%2C’Jacqueline’)%2C%0A%0940%20%3D%26gt%3B%20array(‘2’%2C’9’%2C’Apolline’)%2C%0A%0941%20%3D%26gt%3B%20array(‘2’%2C’10’%2C’Arnaud’)%2C%0A%0942%20%3D%26gt%3B%20array(‘2’%2C’11’%2C’Notre%20Dame%20de%20Lourdes’)%2C%0A%0943%20%3D%26gt%3B%20array(‘2’%2C’12’%2C’F%C3%A9lix’)%2C%0A%0944%20%3D%26gt%3B%20array(‘2’%2C’13’%2C’B%C3%A9atrice’)%2C%0A%0945%20%3D%26gt%3B%20array(‘2’%2C’14’%2C’Valentin’)%2C%0A%0946%20%3D%26gt%3B%20array(‘2’%2C’15’%2C’Claude’)%2C%0A%0947%20%3D%26gt%3B%20array(‘2’%2C’16’%2C’Julienne’)%2C%0A%0948%20%3D%26gt%3B%20array(‘2’%2C’17’%2C’Alexis’)%2C%0A%0949%20%3D%26gt%3B%20array(‘2’%2C’18’%2C’Bernadette’)%2C%0A%0950%20%3D%26gt%3B%20array(‘2’%2C’19’%2C’Gabin’)%2C%0A%0951%20%3D%26gt%3B%20array(‘2’%2C’20’%2C’Aim%C3%A9e’)%2C%0A%0952%20%3D%26gt%3B%20array(‘2’%2C’21’%2C’Damien’)%2C%0A%0953%20%3D%26gt%3B%20array(‘2’%2C’22’%2C’Isabelle’)%2C%0A%0954%20%3D%26gt%3B%20array(‘2’%2C’23’%2C’Lazare’)%2C%0A%0955%20%3D%26gt%3B%20array(‘2’%2C’24’%2C’Modeste’)%2C%0A%0956%20%3D%26gt%3B%20array(‘2’%2C’25’%2C’Rom%C3%A9o’)%2C%0A%0957%20%3D%26gt%3B%20array(‘2’%2C’26’%2C’Nestor’)%2C%0A%0958%20%3D%26gt%3B%20array(‘2’%2C’27’%2C’Honorine’)%2C%0A%0959%20%3D%26gt%3B%20array(‘2’%2C’28’%2C’Romain’)%2C%0A%0960%20%3D%26gt%3B%20array(’21’%2C’29’%2C’Auguste’)%2C%0A%0961%20%3D%26gt%3B%20array(‘3’%2C’1’%2C’Aubin’)%2C%0A%0962%20%3D%26gt%3B%20array(‘3’%2C’2’%2C’Charles%20le%20Bon’)%2C%0A%0963%20%3D%26gt%3B%20array(‘3’%2C’3’%2C’Gu%C3%A9nol%C3%A9’)%2C%0A%0964%20%3D%26gt%3B%20array(‘3’%2C’4’%2C’Casimir’)%2C%0A%0965%20%3D%26gt%3B%20array(‘3’%2C’5’%2C’Olive’)%2C%0A%0966%20%3D%26gt%3B%20array(‘3’%2C’6’%2C’Colette’)%2C%0A%0967%20%3D%26gt%3B%20array(‘3’%2C’7’%2C’F%C3%A9licit%C3%A9’)%2C%0A%0968%20%3D%26gt%3B%20array(‘3’%2C’8’%2C’Jean%20de%20Dieu’)%2C%0A%0969%20%3D%26gt%3B%20array(‘3’%2C’9’%2C’Fran%C3%A7oise’)%2C%0A%0970%20%3D%26gt%3B%20array(‘3’%2C’10’%2C’Vivien’)%2C%0A%0971%20%3D%26gt%3B%20array(‘3’%2C’11’%2C’Rosine’)%2C%0A%0972%20%3D%26gt%3B%20array(‘3’%2C’12’%2C’Justine’)%2C%0A%0973%20%3D%26gt%3B%20array(‘3’%2C’13’%2C’Rodrigue’)%2C%0A%0974%20%3D%26gt%3B%20array(‘3’%2C’14’%2C’Mathilde’)%2C%0A%0975%20%3D%26gt%3B%20array(‘3’%2C’15’%2C’Louise’)%2C%0A%0976%20%3D%26gt%3B%20array(‘3’%2C’16’%2C’B%C3%A9n%C3%A9dicte’)%2C%0A%0977%20%3D%26gt%3B%20array(‘3’%2C’17’%2C’Patrice’)%2C%0A%0978%20%3D%26gt%3B%20array(‘3’%2C’18’%2C’Cyrille’)%2C%0A%0979%20%3D%26gt%3B%20array(‘3’%2C’19’%2C’Joseph’)%2C%0A%0980%20%3D%26gt%3B%20array(‘3’%2C’20’%2C’Herbert’)%2C%0A%0981%20%3D%26gt%3B%20array(‘3’%2C’21’%2C’Cl%C3%A9mence%20-%20PRINTEMPS’)%2C%0A%0982%20%3D%26gt%3B%20array(‘3’%2C’22’%2C’L%C3%A9a’)%2C%0A%0983%20%3D%26gt%3B%20array(‘3’%2C’23’%2C’Victorien’)%2C%0A%0984%20%3D%26gt%3B%20array(‘3’%2C’24’%2C’Catherine’)%2C%0A%0985%20%3D%26gt%3B%20array(‘3’%2C’25’%2C’Annonciation’)%2C%0A%0986%20%3D%26gt%3B%20array(‘3’%2C’26’%2C’Larissa’)%2C%0A%0987%20%3D%26gt%3B%20array(‘3’%2C’27’%2C’Habib’)%2C%0A%0988%20%3D%26gt%3B%20array(‘3’%2C’28’%2C’Gontran’)%2C%0A%0989%20%3D%26gt%3B%20array(‘3’%2C’29’%2C’Gwladys’)%2C%0A%0990%20%3D%26gt%3B%20array(‘3’%2C’30’%2C’Am%C3%A9d%C3%A9e’)%2C%0A%0991%20%3D%26gt%3B%20array(‘3’%2C’31’%2C’Benjamin’)%2C%0A%0992%20%3D%26gt%3B%20array(‘4’%2C’1’%2C’Hugues’)%2C%0A%0993%20%3D%26gt%3B%20array(‘4’%2C’2’%2C’Sandrine’)%2C%0A%0994%20%3D%26gt%3B%20array(‘4’%2C’3’%2C’Richard’)%2C%0A%0995%20%3D%26gt%3B%20array(‘4’%2C’4’%2C’Isidore’)%2C%0A%0996%20%3D%26gt%3B%20array(‘4’%2C’5’%2C’Ir%C3%A8ne’)%2C%0A%0997%20%3D%26gt%3B%20array(‘4’%2C’6’%2C’Marcellin’)%2C%0A%0998%20%3D%26gt%3B%20array(‘4’%2C’7’%2C’Jean-Baptiste%20de%20la%20Salle’)%2C%0A%0999%20%3D%26gt%3B%20array(‘4’%2C’8’%2C’Julie’)%2C%0A%09100%20%3D%26gt%3B%20array(‘4’%2C’9’%2C’Gautier’)%2C%0A%09101%20%3D%26gt%3B%20array(‘4’%2C’10’%2C’Fulbert’)%2C%0A%09102%20%3D%26gt%3B%20array(‘4’%2C’11’%2C’Stanislas’)%2C%0A%09103%20%3D%26gt%3B%20array(‘4’%2C’12’%2C’Jules’)%2C%0A%09104%20%3D%26gt%3B%20array(‘4’%2C’13’%2C’Ida’)%2C%0A%09105%20%3D%26gt%3B%20array(‘4’%2C’14’%2C’Maxime’)%2C%0A%09106%20%3D%26gt%3B%20array(‘4’%2C’15’%2C’Paterne’)%2C%0A%09107%20%3D%26gt%3B%20array(‘4’%2C’16’%2C’Beno%C3%AEt%20et%20Joseph’)%2C%0A%09108%20%3D%26gt%3B%20array(‘4’%2C’17’%2C’Anicet’)%2C%0A%09109%20%3D%26gt%3B%20array(‘4’%2C’18’%2C’Parfait’)%2C%0A%09110%20%3D%26gt%3B%20array(‘4’%2C’19’%2C’Emma’)%2C%0A%09111%20%3D%26gt%3B%20array(‘4’%2C’20’%2C’Odette’)%2C%0A%09112%20%3D%26gt%3B%20array(‘4’%2C’21’%2C’Anselme’)%2C%0A%09113%20%3D%26gt%3B%20array(‘4’%2C’22’%2C’Alexandre’)%2C%0A%09114%20%3D%26gt%3B%20array(‘4’%2C’23’%2C’Georges’)%2C%0A%09115%20%3D%26gt%3B%20array(‘4’%2C’24’%2C’Fid%C3%A8le’)%2C%0A%09116%20%3D%26gt%3B%20array(‘4’%2C’25’%2C’Marc’)%2C%0A%09117%20%3D%26gt%3B%20array(‘4’%2C’26’%2C’Alida’)%2C%0A%09118%20%3D%26gt%3B%20array(‘4’%2C’27’%2C’Zita’)%2C%0A%09119%20%3D%26gt%3B%20array(‘4’%2C’28’%2C’Val%C3%A9rie’)%2C%0A%09120%20%3D%26gt%3B%20array(‘4’%2C’29’%2C’Catherine%20de%20Sienne’)%2C%0A%09121%20%3D%26gt%3B%20array(‘4’%2C’30’%2C’Robert’)%2C%0A%09122%20%3D%26gt%3B%20array(‘5’%2C’1’%2C’F%C3%AAte%20du%20travail’)%2C%0A%09123%20%3D%26gt%3B%20array(‘5’%2C’2’%2C’Boris’)%2C%0A%09124%20%3D%26gt%3B%20array(‘5’%2C’3’%2C’Philippe%20et%20Jacques’)%2C%0A%09125%20%3D%26gt%3B%20array(‘5’%2C’4’%2C’Sylvain’)%2C%0A%09126%20%3D%26gt%3B%20array(‘5’%2C’5’%2C’Judith’)%2C%0A%09127%20%3D%26gt%3B%20array(‘5’%2C’6’%2C’Prudence’)%2C%0A%09128%20%3D%26gt%3B%20array(‘5’%2C’7’%2C’Gis%C3%A8le’)%2C%0A%09129%20%3D%26gt%3B%20array(‘5’%2C’8’%2C’Armistice%201945’)%2C%0A%09130%20%3D%26gt%3B%20array(‘5’%2C’9’%2C’Jeanne%20d%5C’Arc’)%2C%0A%09131%20%3D%26gt%3B%20array(‘5’%2C’10’%2C’Solange’)%2C%0A%09132%20%3D%26gt%3B%20array(‘5’%2C’11’%2C’Estelle’)%2C%0A%09133%20%3D%26gt%3B%20array(‘5’%2C’12’%2C’Achille’)%2C%0A%09134%20%3D%26gt%3B%20array(‘5’%2C’13’%2C’Rolande’)%2C%0A%09135%20%3D%26gt%3B%20array(‘5’%2C’14’%2C’Matthias’)%2C%0A%09136%20%3D%26gt%3B%20array(‘5’%2C’15’%2C’Denise’)%2C%0A%09137%20%3D%26gt%3B%20array(‘5’%2C’16’%2C’Honor%C3%A9’)%2C%0A%09138%20%3D%26gt%3B%20array(‘5’%2C’17’%2C’Pascal’)%2C%0A%09139%20%3D%26gt%3B%20array(‘5’%2C’18’%2C’Eric’)%2C%0A%09140%20%3D%26gt%3B%20array(‘5’%2C’19’%2C’Yves’)%2C%0A%09141%20%3D%26gt%3B%20array(‘5’%2C’20’%2C’Bernardin’)%2C%0A%09142%20%3D%26gt%3B%20array(‘5’%2C’21’%2C’Constantin’)%2C%0A%09143%20%3D%26gt%3B%20array(‘5’%2C’22’%2C’Emile’)%2C%0A%09144%20%3D%26gt%3B%20array(‘5’%2C’23’%2C’Didier’)%2C%0A%09145%20%3D%26gt%3B%20array(‘5’%2C’24’%2C’Donatien’)%2C%0A%09146%20%3D%26gt%3B%20array(‘5’%2C’25’%2C’Sophie’)%2C%0A%09147%20%3D%26gt%3B%20array(‘5’%2C’26’%2C’B%C3%A9renger’)%2C%0A%09148%20%3D%26gt%3B%20array(‘5’%2C’27’%2C’Augustin’)%2C%0A%09149%20%3D%26gt%3B%20array(‘5’%2C’28’%2C’Germain’)%2C%0A%09150%20%3D%26gt%3B%20array(‘5’%2C’29’%2C’Aymar’)%2C%0A%09151%20%3D%26gt%3B%20array(‘5’%2C’30’%2C’Ferdinand’)%2C%0A%09152%20%3D%26gt%3B%20array(‘5’%2C’31’%2C’Visitation%20de%20la%20Sainte%20Vierge’)%2C%0A%09153%20%3D%26gt%3B%20array(‘6’%2C’1’%2C’Justin’)%2C%0A%09154%20%3D%26gt%3B%20array(‘6’%2C’2’%2C’Blandine’)%2C%0A%09155%20%3D%26gt%3B%20array(‘6’%2C’3’%2C’K%C3%A9vin’)%2C%0A%09156%20%3D%26gt%3B%20array(‘6’%2C’4’%2C’Clotilde’)%2C%0A%09157%20%3D%26gt%3B%20array(‘6’%2C’5’%2C’Igor’)%2C%0A%09158%20%3D%26gt%3B%20array(‘6’%2C’6’%2C’Norbert’)%2C%0A%09159%20%3D%26gt%3B%20array(‘6’%2C’7’%2C’Gilbert’)%2C%0A%09160%20%3D%26gt%3B%20array(‘6’%2C’8’%2C’M%C3%A9dard’)%2C%0A%09161%20%3D%26gt%3B%20array(‘6’%2C’9’%2C’Diane’)%2C%0A%09162%20%3D%26gt%3B%20array(‘6’%2C’10’%2C’Landry’)%2C%0A%09163%20%3D%26gt%3B%20array(‘6’%2C’11’%2C’Barnab%C3%A9’)%2C%0A%09164%20%3D%26gt%3B%20array(‘6’%2C’12’%2C’Guy’)%2C%0A%09165%20%3D%26gt%3B%20array(‘6’%2C’13’%2C’Antoine%20de%20Padoue’)%2C%0A%09166%20%3D%26gt%3B%20array(‘6’%2C’14’%2C’Elis%C3%A9e’)%2C%0A%09167%20%3D%26gt%3B%20array(‘6’%2C’15’%2C’Germaine’)%2C%0A%09168%20%3D%26gt%3B%20array(‘6’%2C’16’%2C’Jean%20Fran%C3%A7ois%20R%C3%A9gis’)%2C%0A%09169%20%3D%26gt%3B%20array(‘6’%2C’17’%2C’Herv%C3%A9’)%2C%0A%09170%20%3D%26gt%3B%20array(‘6’%2C’18’%2C’L%C3%A9once’)%2C%0A%09171%20%3D%26gt%3B%20array(‘6’%2C’19’%2C’Romuald’)%2C%0A%09172%20%3D%26gt%3B%20array(‘6’%2C’20’%2C’Silv%C3%A8re’)%2C%0A%09173%20%3D%26gt%3B%20array(‘6’%2C’21’%2C’Rodolph%20-%20ETE’)%2C%0A%09174%20%3D%26gt%3B%20array(‘6’%2C’22’%2C’Alban’)%2C%0A%09175%20%3D%26gt%3B%20array(‘6’%2C’23’%2C’Audrey’)%2C%0A%09176%20%3D%26gt%3B%20array(‘6’%2C’24’%2C’Jean-Baptiste’)%2C%0A%09177%20%3D%26gt%3B%20array(‘6’%2C’25’%2C’Prosper’)%2C%0A%09178%20%3D%26gt%3B%20array(‘6’%2C’26’%2C’Anthelme’)%2C%0A%09179%20%3D%26gt%3B%20array(‘6’%2C’27’%2C’Fernand’)%2C%0A%09180%20%3D%26gt%3B%20array(‘6’%2C’28’%2C’Ir%C3%A9n%C3%A9e’)%2C%0A%09181%20%3D%26gt%3B%20array(‘6’%2C’29’%2C’Pierre%20et%20Paul’)%2C%0A%09182%20%3D%26gt%3B%20array(‘6’%2C’30’%2C’Martial’)%2C%0A%09183%20%3D%26gt%3B%20array(‘7’%2C’1’%2C’Thierry’)%2C%0A%09184%20%3D%26gt%3B%20array(‘7’%2C’2’%2C’Martinien’)%2C%0A%09185%20%3D%26gt%3B%20array(‘7’%2C’3’%2C’Thomas’)%2C%0A%09186%20%3D%26gt%3B%20array(‘7’%2C’4’%2C’Florent’)%2C%0A%09187%20%3D%26gt%3B%20array(‘7’%2C’5’%2C’Antoine’)%2C%0A%09188%20%3D%26gt%3B%20array(‘7’%2C’6’%2C’Mariette’)%2C%0A%09189%20%3D%26gt%3B%20array(‘7’%2C’7’%2C’Raoul’)%2C%0A%09190%20%3D%26gt%3B%20array(‘7’%2C’8’%2C’Thibault’)%2C%0A%09191%20%3D%26gt%3B%20array(‘7’%2C’9’%2C’Amandine’)%2C%0A%09192%20%3D%26gt%3B%20array(‘7’%2C’10’%2C’Ulrich’)%2C%0A%09193%20%3D%26gt%3B%20array(‘7’%2C’11’%2C’Beno%C3%AFt’)%2C%0A%09194%20%3D%26gt%3B%20array(‘7’%2C’12’%2C’Olivier’)%2C%0A%09195%20%3D%26gt%3B%20array(‘7’%2C’13’%2C’Henri%20et%20Jo%C3%ABl’)%2C%0A%09196%20%3D%26gt%3B%20array(‘7’%2C’14’%2C’F%C3%AAte%20Nationale’)%2C%0A%09197%20%3D%26gt%3B%20array(‘7’%2C’15’%2C’Donald’)%2C%0A%09198%20%3D%26gt%3B%20array(‘7’%2C’16’%2C’Nte%20Dame%20Mt%20Carmel’)%2C%0A%09199%20%3D%26gt%3B%20array(‘7’%2C’17’%2C’Charlotte’)%2C%0A%09200%20%3D%26gt%3B%20array(‘7’%2C’18’%2C’Fr%C3%A9d%C3%A9ric’)%2C%0A%09201%20%3D%26gt%3B%20array(‘7’%2C’19’%2C’Ars%C3%A8ne’)%2C%0A%09202%20%3D%26gt%3B%20array(‘7’%2C’20’%2C’Marina’)%2C%0A%09203%20%3D%26gt%3B%20array(‘7’%2C’21’%2C’Victor’)%2C%0A%09204%20%3D%26gt%3B%20array(‘7’%2C’22’%2C’Marie%20Madeleine’)%2C%0A%09205%20%3D%26gt%3B%20array(‘7’%2C’23’%2C’Brigitte’)%2C%0A%09206%20%3D%26gt%3B%20array(‘7’%2C’24’%2C’Christine’)%2C%0A%09207%20%3D%26gt%3B%20array(‘7’%2C’25’%2C’Jacques’)%2C%0A%09208%20%3D%26gt%3B%20array(‘7’%2C’26’%2C’Anne%20et%20Joachim’)%2C%0A%09209%20%3D%26gt%3B%20array(‘7’%2C’27’%2C’Nathalie’)%2C%0A%09210%20%3D%26gt%3B%20array(‘7’%2C’28’%2C’Samson’)%2C%0A%09211%20%3D%26gt%3B%20array(‘7’%2C’29’%2C’Marthe’)%2C%0A%09212%20%3D%26gt%3B%20array(‘7’%2C’30’%2C’Juliette’)%2C%0A%09213%20%3D%26gt%3B%20array(‘7’%2C’31’%2C’Ignace%20de%20Loyola’)%2C%0A%09214%20%3D%26gt%3B%20array(‘8’%2C’1’%2C’Alphonse’)%2C%0A%09215%20%3D%26gt%3B%20array(‘8’%2C’2’%2C’Julien%20et%20Eymard’)%2C%0A%09216%20%3D%26gt%3B%20array(‘8’%2C’3’%2C’Lydie’)%2C%0A%09217%20%3D%26gt%3B%20array(‘8’%2C’4’%2C’Jean-Marie%20Vianney’)%2C%0A%09218%20%3D%26gt%3B%20array(‘8’%2C’5’%2C’Abel’)%2C%0A%09219%20%3D%26gt%3B%20array(‘8’%2C’6’%2C’Transfiguration’)%2C%0A%09220%20%3D%26gt%3B%20array(‘8’%2C’7’%2C’Ga%C3%A9tan’)%2C%0A%09221%20%3D%26gt%3B%20array(‘8’%2C’8’%2C’Dominique’)%2C%0A%09222%20%3D%26gt%3B%20array(‘8’%2C’9’%2C’Amour’)%2C%0A%09223%20%3D%26gt%3B%20array(‘8’%2C’10’%2C’Laurent’)%2C%0A%09224%20%3D%26gt%3B%20array(‘8’%2C’11’%2C’Claire’)%2C%0A%09225%20%3D%26gt%3B%20array(‘8’%2C’12’%2C’Clarisse’)%2C%0A%09226%20%3D%26gt%3B%20array(‘8’%2C’13’%2C’Hippolyte’)%2C%0A%09227%20%3D%26gt%3B%20array(‘8’%2C’14’%2C’Evrard’)%2C%0A%09228%20%3D%26gt%3B%20array(‘8’%2C’15’%2C’Assomption’)%2C%0A%09229%20%3D%26gt%3B%20array(‘8’%2C’16’%2C’Armel’)%2C%0A%09230%20%3D%26gt%3B%20array(‘8’%2C’17’%2C’Hyacinthe’)%2C%0A%09231%20%3D%26gt%3B%20array(‘8’%2C’18’%2C’H%C3%A9l%C3%A8ne’)%2C%0A%09232%20%3D%26gt%3B%20array(‘8’%2C’19’%2C’Jean%20Eudes’)%2C%0A%09233%20%3D%26gt%3B%20array(‘8’%2C’20’%2C’Bernard’)%2C%0A%09234%20%3D%26gt%3B%20array(‘8’%2C’21’%2C’Christophe’)%2C%0A%09235%20%3D%26gt%3B%20array(‘8’%2C’22’%2C’Fabrice’)%2C%0A%09236%20%3D%26gt%3B%20array(‘8’%2C’23’%2C’Rose%20de%20Lima’)%2C%0A%09237%20%3D%26gt%3B%20array(‘8’%2C’24’%2C’Barth%C3%A9l%C3%A9my’)%2C%0A%09238%20%3D%26gt%3B%20array(‘8’%2C’25’%2C’Louis’)%2C%0A%09239%20%3D%26gt%3B%20array(‘8’%2C’26’%2C’Natacha’)%2C%0A%09240%20%3D%26gt%3B%20array(‘8’%2C’27’%2C’Monique’)%2C%0A%09241%20%3D%26gt%3B%20array(‘8’%2C’28’%2C’Augustin’)%2C%0A%09242%20%3D%26gt%3B%20array(‘8’%2C’29’%2C’Sabine’)%2C%0A%09243%20%3D%26gt%3B%20array(‘8’%2C’30’%2C’Fiacre’)%2C%0A%09244%20%3D%26gt%3B%20array(‘8’%2C’31’%2C’Aristide’)%2C%0A%09245%20%3D%26gt%3B%20array(‘9’%2C’1’%2C’Gilles’)%2C%0A%09246%20%3D%26gt%3B%20array(‘9’%2C’2’%2C’Ingrid’)%2C%0A%09247%20%3D%26gt%3B%20array(‘9’%2C’3’%2C’Gr%C3%A9goire’)%2C%0A%09248%20%3D%26gt%3B%20array(‘9’%2C’4’%2C’Rosalie’)%2C%0A%09249%20%3D%26gt%3B%20array(‘9’%2C’5’%2C’Ra%C3%AFssa’)%2C%0A%09250%20%3D%26gt%3B%20array(‘9’%2C’6’%2C’Bertrand’)%2C%0A%09251%20%3D%26gt%3B%20array(‘9’%2C’7’%2C’Reine’)%2C%0A%09252%20%3D%26gt%3B%20array(‘9’%2C’8’%2C’Nativit%C3%A9’)%2C%0A%09253%20%3D%26gt%3B%20array(‘9’%2C’9’%2C’Alain’)%2C%0A%09254%20%3D%26gt%3B%20array(‘9’%2C’10’%2C’In%C3%A8s’)%2C%0A%09255%20%3D%26gt%3B%20array(‘9’%2C’11’%2C’Adelphe’)%2C%0A%09256%20%3D%26gt%3B%20array(‘9’%2C’12’%2C’Apollinaire’)%2C%0A%09257%20%3D%26gt%3B%20array(‘9’%2C’13’%2C’Aim%C3%A9’)%2C%0A%09258%20%3D%26gt%3B%20array(‘9’%2C’14’%2C’Croix%20Glorieuse’)%2C%0A%09259%20%3D%26gt%3B%20array(‘9’%2C’15’%2C’Roland’)%2C%0A%09260%20%3D%26gt%3B%20array(‘9’%2C’16’%2C’Edith’)%2C%0A%09261%20%3D%26gt%3B%20array(‘9’%2C’17’%2C’Renaud’)%2C%0A%09262%20%3D%26gt%3B%20array(‘9’%2C’18’%2C’Nad%C3%A8ge’)%2C%0A%09263%20%3D%26gt%3B%20array(‘9’%2C’19’%2C’Emilie’)%2C%0A%09264%20%3D%26gt%3B%20array(‘9’%2C’20’%2C’Davy’)%2C%0A%09265%20%3D%26gt%3B%20array(‘9’%2C’21’%2C’Matthieu’)%2C%0A%09266%20%3D%26gt%3B%20array(‘9’%2C’22’%2C’Maurice’)%2C%0A%09267%20%3D%26gt%3B%20array(‘9’%2C’23’%2C’Constant%20-%20AUTOMNE’)%2C%0A%09268%20%3D%26gt%3B%20array(‘9’%2C’24’%2C’Th%C3%A8cle’)%2C%0A%09269%20%3D%26gt%3B%20array(‘9’%2C’25’%2C’Hermann’)%2C%0A%09270%20%3D%26gt%3B%20array(‘9’%2C’26’%2C’C%C3%B4me%20et%20Damien’)%2C%0A%09271%20%3D%26gt%3B%20array(‘9’%2C’27’%2C’Vincent%20de%20Paul’)%2C%0A%09272%20%3D%26gt%3B%20array(‘9’%2C’28’%2C’Venceslas’)%2C%0A%09273%20%3D%26gt%3B%20array(‘9’%2C’29’%2C’Michel%2C%20Gabriel%20et%20Rapha%C3%ABl’)%2C%0A%09274%20%3D%26gt%3B%20array(‘9’%2C’30’%2C’J%C3%A9r%C3%B4me’)%2C%0A%09275%20%3D%26gt%3B%20array(’10’%2C’1’%2C’Th%C3%A9r%C3%A8se%20de%20l%5C’Enfant%20J%C3%A9sus’)%2C%0A%09276%20%3D%26gt%3B%20array(’10’%2C’2’%2C’L%C3%A9ger’)%2C%0A%09277%20%3D%26gt%3B%20array(’10’%2C’3’%2C’G%C3%A9rard’)%2C%0A%09278%20%3D%26gt%3B%20array(’10’%2C’4’%2C’Fran%C3%A7ois%20d%5C’Assise’)%2C%0A%09279%20%3D%26gt%3B%20array(’10’%2C’5’%2C’Fleur’)%2C%0A%09280%20%3D%26gt%3B%20array(’10’%2C’6’%2C’Bruno’)%2C%0A%09281%20%3D%26gt%3B%20array(’10’%2C’7’%2C’Serge’)%2C%0A%09282%20%3D%26gt%3B%20array(’10’%2C’8’%2C’P%C3%A9lagie’)%2C%0A%09283%20%3D%26gt%3B%20array(’10’%2C’9’%2C’Denis’)%2C%0A%09284%20%3D%26gt%3B%20array(’10’%2C’10’%2C’Ghislain’)%2C%0A%09285%20%3D%26gt%3B%20array(’10’%2C’11’%2C’Firmin’)%2C%0A%09286%20%3D%26gt%3B%20array(’10’%2C’12’%2C’Wilfried’)%2C%0A%09287%20%3D%26gt%3B%20array(’10’%2C’13’%2C’G%C3%A9raud’)%2C%0A%09288%20%3D%26gt%3B%20array(’10’%2C’14’%2C’Juste’)%2C%0A%09289%20%3D%26gt%3B%20array(’10’%2C’15’%2C’Th%C3%A9r%C3%A8se%20d%5C’Avila’)%2C%0A%09290%20%3D%26gt%3B%20array(’10’%2C’16’%2C’Edwige’)%2C%0A%09291%20%3D%26gt%3B%20array(’10’%2C’17’%2C’Baudoin’)%2C%0A%09292%20%3D%26gt%3B%20array(’10’%2C’18’%2C’Luc’)%2C%0A%09293%20%3D%26gt%3B%20array(’10’%2C’19’%2C’Ren%C3%A9′)%2C%0A%09294%20%3D%26gt%3B%20array(’10’%2C’20’%2C’Adeline’)%2C%0A%09295%20%3D%26gt%3B%20array(’10’%2C’21’%2C’C%C3%A9line’)%2C%0A%09296%20%3D%26gt%3B%20array(’10’%2C’22’%2C’Elodie’)%2C%0A%09297%20%3D%26gt%3B%20array(’10’%2C’23’%2C’Jean%20de%20Capistran’)%2C%0A%09298%20%3D%26gt%3B%20array(’10’%2C’24’%2C’Florentin’)%2C%0A%09299%20%3D%26gt%3B%20array(’10’%2C’25’%2C’Cr%C3%A9pin’)%2C%0A%09300%20%3D%26gt%3B%20array(’10’%2C’26’%2C’Dimitri’)%2C%0A%09301%20%3D%26gt%3B%20array(’10’%2C’27’%2C’Emeline’)%2C%0A%09302%20%3D%26gt%3B%20array(’10’%2C’28’%2C’Jude’)%2C%0A%09303%20%3D%26gt%3B%20array(’10’%2C’29’%2C’Narcisse’)%2C%0A%09304%20%3D%26gt%3B%20array(’10’%2C’30’%2C’Bienvenu’)%2C%0A%09305%20%3D%26gt%3B%20array(’10’%2C’31’%2C’Quentin’)%2C%0A%09306%20%3D%26gt%3B%20array(’11’%2C’1’%2C’Toussaint’)%2C%0A%09307%20%3D%26gt%3B%20array(’11’%2C’2’%2C’D%C3%A9funts’)%2C%0A%09308%20%3D%26gt%3B%20array(’11’%2C’3’%2C’Hubert’)%2C%0A%09309%20%3D%26gt%3B%20array(’11’%2C’4’%2C’Charles’)%2C%0A%09310%20%3D%26gt%3B%20array(’11’%2C’5’%2C’Sylvie’)%2C%0A%09311%20%3D%26gt%3B%20array(’11’%2C’6’%2C’Bertille’)%2C%0A%09312%20%3D%26gt%3B%20array(’11’%2C’7’%2C’Carine’)%2C%0A%09313%20%3D%26gt%3B%20array(’11’%2C’8’%2C’Geoffroy’)%2C%0A%09314%20%3D%26gt%3B%20array(’11’%2C’9’%2C’Th%C3%A9odore’)%2C%0A%09315%20%3D%26gt%3B%20array(’11’%2C’10’%2C’L%C3%A9on’)%2C%0A%09316%20%3D%26gt%3B%20array(’11’%2C’11’%2C’Armistice%201918′)%2C%0A%09317%20%3D%26gt%3B%20array(’11’%2C’12’%2C’Christian’)%2C%0A%09318%20%3D%26gt%3B%20array(’11’%2C’13’%2C’Brice’)%2C%0A%09319%20%3D%26gt%3B%20array(’11’%2C’14’%2C’Sidoine’)%2C%0A%09320%20%3D%26gt%3B%20array(’11’%2C’15’%2C’Albert’)%2C%0A%09321%20%3D%26gt%3B%20array(’11’%2C’16’%2C’Marguerite’)%2C%0A%09322%20%3D%26gt%3B%20array(’11’%2C’17’%2C’Elisabeth’)%2C%0A%09323%20%3D%26gt%3B%20array(’11’%2C’18’%2C’Aude’)%2C%0A%09324%20%3D%26gt%3B%20array(’11’%2C’19’%2C’Tanguy’)%2C%0A%09325%20%3D%26gt%3B%20array(’11’%2C’20’%2C’Edmond’)%2C%0A%09326%20%3D%26gt%3B%20array(’11’%2C’21’%2C’Pr%C3%A9sence%20de%20Marie’)%2C%0A%09327%20%3D%26gt%3B%20array(’11’%2C’22’%2C’C%C3%A9cile’)%2C%0A%09328%20%3D%26gt%3B%20array(’11’%2C’23’%2C’Cl%C3%A9ment’)%2C%0A%09329%20%3D%26gt%3B%20array(’11’%2C’24’%2C’Flora’)%2C%0A%09330%20%3D%26gt%3B%20array(’11’%2C’25’%2C’Catherine’)%2C%0A%09331%20%3D%26gt%3B%20array(’11’%2C’26’%2C’Delphine’)%2C%0A%09332%20%3D%26gt%3B%20array(’11’%2C’27’%2C’S%C3%A9vrin’)%2C%0A%09333%20%3D%26gt%3B%20array(’11’%2C’28’%2C’Jacques%20de%20la%20Marche’)%2C%0A%09334%20%3D%26gt%3B%20array(’11’%2C’29’%2C’Saturnin’)%2C%0A%09335%20%3D%26gt%3B%20array(’11’%2C’30’%2C’Andr%C3%A9′)%2C%0A%09336%20%3D%26gt%3B%20array(’12’%2C’1’%2C’Florence’)%2C%0A%09337%20%3D%26gt%3B%20array(’12’%2C’2’%2C’Viviane’)%2C%0A%09338%20%3D%26gt%3B%20array(’12’%2C’3’%2C’Fran%C3%A7ois%20Xavier’)%2C%0A%09339%20%3D%26gt%3B%20array(’12’%2C’4’%2C’Barbara’)%2C%0A%09340%20%3D%26gt%3B%20array(’12’%2C’5’%2C’G%C3%A9rald’)%2C%0A%09341%20%3D%26gt%3B%20array(’12’%2C’6’%2C’Nicolas’)%2C%0A%09342%20%3D%26gt%3B%20array(’12’%2C’7’%2C’Ambroise’)%2C%0A%09343%20%3D%26gt%3B%20array(’12’%2C’8’%2C’Immacul%C3%A9e%20Conception’)%2C%0A%09344%20%3D%26gt%3B%20array(’12’%2C’9’%2C’Pierre%20Fourier’)%2C%0A%09345%20%3D%26gt%3B%20array(’12’%2C’10’%2C’Romaric’)%2C%0A%09346%20%3D%26gt%3B%20array(’12’%2C’11’%2C’Daniel’)%2C%0A%09347%20%3D%26gt%3B%20array(’12’%2C’12’%2C’Jeanne-Fran%C3%A7oise%20de%20Chantal’)%2C%0A%09348%20%3D%26gt%3B%20array(’12’%2C’13’%2C’Lucie’)%2C%0A%09349%20%3D%26gt%3B%20array(’12’%2C’14’%2C’Odile’)%2C%0A%09350%20%3D%26gt%3B%20array(’12’%2C’15’%2C’Ninon’)%2C%0A%09351%20%3D%26gt%3B%20array(’12’%2C’16’%2C’Alice’)%2C%0A%09352%20%3D%26gt%3B%20array(’12’%2C’17’%2C’Ga%C3%ABl’)%2C%0A%09353%20%3D%26gt%3B%20array(’12’%2C’18’%2C’Gatien’)%2C%0A%09354%20%3D%26gt%3B%20array(’12’%2C’19’%2C’Urbain’)%2C%0A%09355%20%3D%26gt%3B%20array(’12’%2C’20’%2C’Th%C3%A9ophile’)%2C%0A%09356%20%3D%26gt%3B%20array(’12’%2C’21’%2C’HIVER’)%2C%0A%09357%20%3D%26gt%3B%20array(’12’%2C’22’%2C’Fran%C3%A7oise%20Xavi%C3%A8re’)%2C%0A%09358%20%3D%26gt%3B%20array(’12’%2C’23’%2C’Armand’)%2C%0A%09359%20%3D%26gt%3B%20array(’12’%2C’24’%2C’Ad%C3%A8le’)%2C%0A%09360%20%3D%26gt%3B%20array(’12’%2C’25’%2C’No%C3%ABl’)%2C%0A%09361%20%3D%26gt%3B%20array(’12’%2C’26’%2C’Etienne’)%2C%0A%09362%20%3D%26gt%3B%20array(’12’%2C’27’%2C’Jean’)%2C%0A%09363%20%3D%26gt%3B%20array(’12’%2C’28’%2C’Innocents’)%2C%0A%09364%20%3D%26gt%3B%20array(’12’%2C’29’%2C’David’)%2C%0A%09365%20%3D%26gt%3B%20array(’12’%2C’30’%2C’Roger’)%2C%0A%09366%20%3D%26gt%3B%20array(’12’%2C’31’%2C’Sylvestre’)%0A%0A%09)%3B%0A%0A%09%2F**%0A%09*%20Jour%20de%20la%20semainde%20en%20Fr%20%C3%A0%20utiliser%20avec%20date%20et%20w%0A%09*%20%40var%20array%0A%09*%20%40access%20private%0A%09*%2F%0A%09private%20%24jour_week%20%3D%20array(%0A%0A%090%20%3D%26gt%3B%20’Dimanche’%2C%0A%091%20%3D%26gt%3B%20’Lundi’%2C%0A%092%20%3D%26gt%3B%20’Mardi’%2C%0A%093%20%3D%26gt%3B%20’Mercredi’%2C%0A%094%20%3D%26gt%3B%20’Jeudi’%2C%0A%095%20%3D%26gt%3B%20’Vendredi’%2C%0A%096%20%3D%26gt%3B%20’Samedi’%0A%0A%09)%3B%0A%0A%09%2F**%0A%09*%20Jour%20du%20mois%20en%20Fr%20%C3%A0%20utiliser%20avec%20date%20et%20n%0A%09*%20%40var%20array%0A%09*%20%40access%20private%0A%09*%2F%0A%09private%20%24mois_fr%20%3D%20array(%0A%0A%091%20%3D%26gt%3B%20’Janvier’%2C%0A%092%20%3D%26gt%3B%20’F%C3%A9vrier’%2C%0A%093%20%3D%26gt%3B%20’Mars’%2C%0A%094%20%3D%26gt%3B%20’Avril’%2C%0A%095%20%3D%26gt%3B%20’Mais’%2C%0A%096%20%3D%26gt%3B%20’Juin’%2C%0A%097%20%3D%26gt%3B%20’Juillet’%2C%0A%098%20%3D%26gt%3B%20’Aout’%2C%0A%099%20%3D%26gt%3B%20’Septembre’%2C%0A%0910%20%3D%26gt%3B%20’Octobre’%2C%0A%0911%20%3D%26gt%3B%20’Novembre’%2C%0A%0912%20%3D%26gt%3B%20’D%C3%A9cembre’%0A%0A%09)%3B%0A%0A%09%2F**%0A%09*%20Constructeur%0A%09*%20Initialisation%20des%20variables%0A%09*%20%40return%20void%0A%09*%2F%0A%09public%20function%20__construct()%7B%0A%09%2F%2F%20Pour%20l’instant%20nada%0A%09%7D%0A%0A%09%2F**%0A%09*%20M%C3%A9thode%20public%20(getFete(%5B…%5D))%20donne%20la%20f%C3%AAte%20du%20jour%20pass%C3%A9%20en%20argument%0A%09*%20%40param%20int%20%24date%20%3A%3A%20timestamp%0A%09*%20%40return%20%24string%0A%09*%2F%0A%09public%20function%20getFete(%24date%20%3D%20null)%7B%0A%0A%09%09if(%24date%20%3D%3D%20null)%0A%09%09%09%24date%20%3D%20time()%3B%0A%0A%09%09%24hoy_mes%20%3D%20date(‘m’%2C%20%24date)%3B%0A%09%09%24hoy_dia%20%3D%20date(‘d’%2C%20%24date)%3B%0A%0A%09%09foreach(%24this-%26gt%3Bcal_fetes%20as%20%24cle%3D%26gt%3B%24valeur)%7B%0A%0A%09%09%09if(%24valeur%5B0%5D%20%3D%3D%20%24hoy_mes%20AND%20%24valeur%5B1%5D%20%3D%3D%20%24hoy_dia)%0A%09%09%09return%20%24valeur%5B2%5D%3B%0A%0A%09%09%7D%0A%0A%09%09return%20false%3B%0A%0A%09%7D%0A%0A%09%2F**%0A%09*%20M%C3%A9thode%20public%20(getJourFr(%5B…%5D))%20renvoie%20le%20nom%20du%20jour%20en%20vf%20du%20jour%20pass%C3%A9%20en%20argument%0A%09*%20%40param%20int%20%24date%20%3A%3A%20timestamp%0A%09*%20%40return%20%24string%0A%09*%2F%0A%09public%20function%20getJourFr(%24date%20%3D%20null)%7B%0A%0A%09%09if(%24date%20%3D%3D%20null)%0A%09%09%09%24date%20%3D%20time()%3B%0A%0A%09%09return%20%24this-%26gt%3Bjour_week%5Bdate(‘w’%2C%20%24date)%5D%3B%0A%0A%09%7D%0A%0A%09%2F**%0A%09*%20M%C3%A9thode%20public%20(getMoisFr(%5B…%5D))%20renvoie%20le%20nom%20du%20mois%20en%20vf%20du%20jour%20pass%C3%A9%20en%20argument%0A%09*%20%40param%20int%20%24date%20%3A%3A%20timestamp%0A%09*%20%40return%20%24string%0A%09*%2F%0A%09public%20function%20getMoisFr(%24date%20%3D%20null)%7B%0A%0A%09%09if(%24date%20%3D%3D%20null)%0A%09%09%09%24date%20%3D%20time()%3B%0A%0A%09%09return%20%24this-%26gt%3Bmois_fr%5Bdate(‘n’%2C%20%24date)%5D%3B%0A%0A%09%7D%0A%0A%7D%0A%0A%3F%3E » message= » » highlight= » » provider= »manual »/]

On peut constater dans un premier temps que c’est une sorte de base de données des jours de fêtes. Très utile dans le sens ou beaucoup d’aides sur le web proposent d’enregistrer tout ça dans une BDD type mysql etc… C’est pas toujours pratique et question installation une perte de temps.

Pour l’instant, et pour cette démo, nous n’auront que 3 méthodes, une première permettant de connaitre la fête du jour passé en argument (le jour doit être un Timestamp sous peine de renvoyer une erreur). Par défaut nous auront le jour actuel.

exemple d’utilisation :

[pastacode lang= »php » manual= »include(‘ludikcalendar.class.php’)%3B%0A%24dateClass%20%3D%20new%20ludikcalendar()%3B%0Aecho%20%24dateClass-%3EgetFete()%3B%2F%2F%20renverra%20la%20f%C3%AAte%20du%20jour%20courant%20(exemple%20pour%20un%2018%20aout%20%3A%20H%C3%A9l%C3%A8ne)%0Aecho%20%24dateClass-%3EgetFete(strtotime(’12-02-2010′))%3B%2F%2F%20renverra%20la%20f%C3%AAte%20du%202%20d%C3%A9cembre%20donc%20Viviane » message= » » highlight= » » provider= »manual »/]

La deuxième méthode permet d’avoir des jours en français, et toujours en passant un argument timestamp et par défaut le jour actuel.

exemple d’utilisation :

[pastacode lang= »php » manual= »include(‘ludikcalendar.class.php’)%3B%0A%24dateClass%20%3D%20new%20ludikcalendar()%3B%0Aecho%20%24dateClass-%3EgetJourFr()%3B%2F%2F%20renverra%20le%20nom%20du%20jour%20courant%20en%20fr%20(exemple%20pour%20un%2018%20aout%202010%20%3A%20Mercredi)%0Aecho%20%24dateClass-%3EgetJourFr(strtotime(’12-02-2010′))%3B%2F%2F%20renverra%20le%20nom%20du%20jour%20du%202%20d%C3%A9cembre%20en%20fr%20donc%20jeudi » message= » » highlight= » » provider= »manual »/]

La troisième méthode permet d’avoir des mois en français cette fois, et toujours en passant un argument timestamp et par défaut le mois actuel.

exemple d’utilisation :

[pastacode lang= »php » manual= »include(‘ludikcalendar.class.php’)%3B%0A%24dateClass%20%3D%20new%20ludikcalendar()%3B%0Aecho%20%24dateClass-%3EgetMoisFr()%3B%2F%2F%20renverra%20le%20nom%20du%20mois%20courant%20en%20fr%20(exemple%20pour%20un%2018%20aout%202010%20%3A%20Aout)%0Aecho%20%24dateClass-%3EgetMoisFr(strtotime(’12-02-2010′))%3B%2F%2F%20renverra%20le%20nom%20du%20mois%20du%202%20d%C3%A9cembre%20en%20fr%20donc%20D%C3%A9cembre » message= » » highlight= » » provider= »manual »/]

Voilà pour cette petite classe php qui vous permet de vous entrainer et d’étudier la manière de créer des classes en PHP5.

Si vous avez réalisé des améliorations ou si vous voyez une erreur, n’hésitez pas à le dire.

Vos commentaires sont les bienvenus 🙂

Bon code à tous !

Téléchargez ludikcalendar.class.php

Articles qui pourraient vous intéresser :

Author: Franck Pertegas

Share This Post On

Trackbacks/Pingbacks

  1. Centos – Plesk – Mise à jour version PHP 5.1 vers 5.2 | LudiBlog - [...] PHP – Dates et fêtes en Français [...]
  2. PHP – Class – De l’importance du Flux RSS | LudiBlog - [...] PHP – Dates et fêtes en Français [...]
  3. PHP – Installer XDebug sous WAMP | LudiBlog - [...] PHP – Dates et fêtes en Français [...]
  4. Serveur – Faire pointer son domaine sur un dossier particulier | LudiBlog - [...] PHP – Dates et fêtes en Français [...]
  5. PHP – Tableau des départements Français | LudiBlog - [...] PHP – Dates et fêtes en Français [...]

Submit a Comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *