<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Julien Breux &#187; Fonctions PHP</title>
	<atom:link href="http://www.julien-breux.com/categorie/php/fonctions-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.julien-breux.com</link>
	<description>Consultant - Développeur PHP, Prestashop, Wordpress</description>
	<lastBuildDate>Sun, 13 Jun 2010 18:37:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fonction PHP &#8211; Numéro de semaine en fonction d&#8217;une date au format français</title>
		<link>http://www.julien-breux.com/2009/02/23/fonction-php-numero-de-semaine-en-fonction-dune-date-au-format-francais/</link>
		<comments>http://www.julien-breux.com/2009/02/23/fonction-php-numero-de-semaine-en-fonction-dune-date-au-format-francais/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 13:00:42 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonctions]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[semaine]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=70</guid>
		<description><![CDATA[Description
Fonction retournant le numéro de la semaine en fonction de la date au format français (JJ/MM/AAAA)
Source

&#60;?php
/**
* Fonction retournant le numéro de la semaine en fonction de la date au format français (JJ/MM/AAAA)
* @param string $date Date au format français (JJ/MM/AAAA)
* @return integer Numéro de semaine
*/
function dateFR2WeekNum&#40;$date&#41;
&#123;
  list&#40;$day, $month, $year&#41; = explode&#40;'/', $date&#41;;
  $weekNum [...]]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction retournant le numéro de la semaine en fonction de la date au format français (JJ/MM/AAAA)</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction retournant le numéro de la semaine en fonction de la date au format français (JJ/MM/AAAA)
* @param string $date Date au format français (JJ/MM/AAAA)
* @return integer Numéro de semaine
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> dateFR2WeekNum<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$day</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$weekNum</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'W'</span><span style="color: #339933;">,</span> <span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$weekNum</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> dateFR2WeekNum<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1987-01-16'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Affiche 3</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/dateFR2WeekNum.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/23/fonction-php-numero-de-semaine-en-fonction-dune-date-au-format-francais/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonction PHP &#8211; Numéro de semaine en fonction d&#8217;une date au format américain</title>
		<link>http://www.julien-breux.com/2009/02/22/fonction-php-numero-de-semaine-en-fonction-dune-date-americaine/</link>
		<comments>http://www.julien-breux.com/2009/02/22/fonction-php-numero-de-semaine-en-fonction-dune-date-americaine/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 13:00:04 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonctions]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[semaine]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=65</guid>
		<description><![CDATA[Description
Fonction retournant le numéro de la semaine en fonction de la date au format américain (AAAA-MM-JJ)
Source

&#60;?php
/**
* Fonction retournant le numéro de la semaine en fonction de la date au format américain (AAAA-MM-JJ)
* @param string $date Date au format américain (AAAA-MM-JJ)
* @return integer Numéro de semaine
*/
function dateUS2WeekNum&#40;$date&#41;
&#123;
  list&#40;$year, $month, $day&#41; = explode&#40;'-', $date&#41;;
  $weekNum [...]]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction retournant le numéro de la semaine en fonction de la date au format américain (AAAA-MM-JJ)</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction retournant le numéro de la semaine en fonction de la date au format américain (AAAA-MM-JJ)
* @param string $date Date au format américain (AAAA-MM-JJ)
* @return integer Numéro de semaine
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> dateUS2WeekNum<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$year</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$weekNum</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'W'</span><span style="color: #339933;">,</span> <span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$weekNum</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> dateUS2WeekNum<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1987-01-16'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Affiche 3</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/dateUS2WeekNum.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/22/fonction-php-numero-de-semaine-en-fonction-dune-date-americaine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonction PHP &#8211; Vérifier si une année est bissextile</title>
		<link>http://www.julien-breux.com/2009/02/21/fonction-php-verifier-si-une-annee-est-bissextile/</link>
		<comments>http://www.julien-breux.com/2009/02/21/fonction-php-verifier-si-une-annee-est-bissextile/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 13:00:08 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[année]]></category>
		<category><![CDATA[bissextile]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonctions]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=58</guid>
		<description><![CDATA[Description
Fonction de verification si une année est bissextile.
Source

&#60;?php
/**
* Fonction de verification si une année est bissextile.
* @param integer $year Année (AAAA)
* @return boolean Vrai ou Faux
*/
function isLeapYear&#40;$year&#41;
&#123;
  return &#40;cal_days_in_month&#40;CAL_GREGORIAN, 2, $year&#41; === 29&#41; ? true : false;
&#125;
?&#62;

Exemple

&#60;?php
if&#40;isLeapYear&#40;2012&#41;&#41;
&#123;
  echo &#34;Cette année est une année bissextile.&#34;;
&#125;
else
&#123;
  echo &#34;Cette année n'est pas une année bissextile.&#34;;
&#125;
// [...]]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction de verification si une année est bissextile.</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction de verification si une année est bissextile.
* @param integer $year Année (AAAA)
* @return boolean Vrai ou Faux
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> isLeapYear<span style="color: #009900;">&#40;</span><span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">cal_days_in_month</span><span style="color: #009900;">&#40;</span>CAL_GREGORIAN<span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #cc66cc;">29</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>isLeapYear<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2012</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Cette année est une année bissextile.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Cette année n'est pas une année bissextile.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// Affiche Cette année est une année bissextile.</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/isLeapYear.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/21/fonction-php-verifier-si-une-annee-est-bissextile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonction PHP &#8211; Timestamp vers Date/Heure américaine</title>
		<link>http://www.julien-breux.com/2009/02/20/fonction-php-timestamp-vers-dateheure-americaine/</link>
		<comments>http://www.julien-breux.com/2009/02/20/fonction-php-timestamp-vers-dateheure-americaine/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 13:00:22 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonctions]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=48</guid>
		<description><![CDATA[Description
Fonction de conversion d&#8217;un Timestamp (en seconde) vers la date/heure au format américain (AAAA-MM-JJ HH:MM:SS).
Source

&#60;?php
/**
* Fonction de conversion d'un Timestamp (en seconde) vers la date/heure au format américain (AAAA-MM-JJ HH:MM:SS).
* @param integer $timestamp Timestamp (en seconde)
* @return string Date/heure au format américain (AAAA-MM-JJ HH:MM:SS)
*/
function time2DatetimeUS&#40;$timestamp&#41;
&#123;
  $datetime = date&#40;'Y-m-d H:i:s', $timestamp&#41;;
  return $datetime;
&#125;
?&#62;

Exemple

&#60;?php
echo time2DatetimeUS&#40;537753723&#41;; [...]]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction de conversion d&#8217;un Timestamp (en seconde) vers la date/heure au format américain (AAAA-MM-JJ HH:MM:SS).</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction de conversion d'un Timestamp (en seconde) vers la date/heure au format américain (AAAA-MM-JJ HH:MM:SS).
* @param integer $timestamp Timestamp (en seconde)
* @return string Date/heure au format américain (AAAA-MM-JJ HH:MM:SS)
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> time2DatetimeUS<span style="color: #009900;">&#40;</span><span style="color: #000088;">$timestamp</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$datetime</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$timestamp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$datetime</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> time2DatetimeUS<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">537753723</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Affiche 1987-01-16 01:02:03</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/time2DatetimeUS.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/20/fonction-php-timestamp-vers-dateheure-americaine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonction PHP &#8211; Nombre de jours dans le mois</title>
		<link>http://www.julien-breux.com/2009/02/19/fonction-php-nombre-de-jours-dans-le-mois/</link>
		<comments>http://www.julien-breux.com/2009/02/19/fonction-php-nombre-de-jours-dans-le-mois/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 13:00:05 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonction]]></category>
		<category><![CDATA[mois]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=53</guid>
		<description><![CDATA[Description
Fonction retournant le nombre de jours dans un mois.
Source

&#60;?php
/**
* Fonction retournant le nombre de jours dans un mois.
* @param integer $month Mois de 1 à 12
* @param integer $year Année
* @return integer Nombre de jours
*/
function maxDaysInMonth&#40;$month, $year&#41;
&#123;
  $days = cal_days_in_month&#40;CAL_GREGORIAN, $month, $year&#41;;
  return $days;
&#125;
?&#62;

Exemple

&#60;?php
echo maxDaysInMonth&#40;02, 2012&#41;; // Affiche 29
?&#62;

Source
Télécharger la source
]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction retournant le nombre de jours dans un mois.</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction retournant le nombre de jours dans un mois.
* @param integer $month Mois de 1 à 12
* @param integer $year Année
* @return integer Nombre de jours
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> maxDaysInMonth<span style="color: #009900;">&#40;</span><span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$days</span> <span style="color: #339933;">=</span> <span style="color: #990000;">cal_days_in_month</span><span style="color: #009900;">&#40;</span>CAL_GREGORIAN<span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$days</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> maxDaysInMonth<span style="color: #009900;">&#40;</span><span style="color: #208080;">02</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2012</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Affiche 29</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/maxDaysInMonth.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/19/fonction-php-nombre-de-jours-dans-le-mois/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fonction PHP &#8211; Date/Heure américaine vers timestamp</title>
		<link>http://www.julien-breux.com/2009/02/18/fonction-php-dateheure-americaine-vers-timestamp/</link>
		<comments>http://www.julien-breux.com/2009/02/18/fonction-php-dateheure-americaine-vers-timestamp/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 13:00:42 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonctions]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=44</guid>
		<description><![CDATA[Description
Fonction de conversion de date/heure du format américain (AAAA-MM-JJ HH:MM:SS) en Timestamp.
Source

&#60;?php
/**
* Fonction de conversion de date/heure du format américain (AAAA-MM-JJ HH:MM:SS) en Timestamp.
* @param string $datetime Date/heure au format américain (AAAA-MM-JJ HH:MM:SS)
* @return integer Timestamp en seconde
*/
function datetimeUS2Time&#40;$datetime&#41;
&#123;
  list&#40;$date, $time&#41; = explode&#40;' ', $datetime&#41;;
  list&#40;$hour, $minute, $second&#41; = explode&#40;':', $time&#41;;
  list&#40;$year, [...]]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction de conversion de date/heure du format américain (AAAA-MM-JJ HH:MM:SS) en Timestamp.</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction de conversion de date/heure du format américain (AAAA-MM-JJ HH:MM:SS) en Timestamp.
* @param string $datetime Date/heure au format américain (AAAA-MM-JJ HH:MM:SS)
* @return integer Timestamp en seconde
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> datetimeUS2Time<span style="color: #009900;">&#40;</span><span style="color: #000088;">$datetime</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #339933;">,</span> <span style="color: #000088;">$time</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$datetime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hour</span><span style="color: #339933;">,</span> <span style="color: #000088;">$minute</span><span style="color: #339933;">,</span> <span style="color: #000088;">$second</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">':'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$time</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$year</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$timestamp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hour</span><span style="color: #339933;">,</span> <span style="color: #000088;">$minute</span><span style="color: #339933;">,</span> <span style="color: #000088;">$second</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$timestamp</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> datetimeUS2Time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1987-01-16 01:02:03'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Affiche 537753723</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/datetimeUS2Time.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/18/fonction-php-dateheure-americaine-vers-timestamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonction PHP &#8211; Date française vers timestamp</title>
		<link>http://www.julien-breux.com/2009/02/17/fonction-php-date-francaise-vers-timestamp/</link>
		<comments>http://www.julien-breux.com/2009/02/17/fonction-php-date-francaise-vers-timestamp/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 14:00:31 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonction]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=40</guid>
		<description><![CDATA[Description
Fonction de conversion de date du format français (JJ/MM/AAAA) en Timestamp.
Source

&#60;?php
/**
* Fonction de conversion de date du format français (JJ/MM/AAAA) en Timestamp.
* @param string $date Date au format français (JJ/MM/AAAA)
* @return integer Timestamp en seconde
*/
function dateFR2Time&#40;$date&#41;
&#123;
  list&#40;$day, $month, $year&#41; = explode&#40;'/', $date&#41;;
  $timestamp = mktime&#40;0, 0, 0, $month, $day, $year&#41;;
  return $timestamp;
&#125;
?&#62;

Exemple

&#60;?php
echo [...]]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction de conversion de date du format français (JJ/MM/AAAA) en Timestamp.</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction de conversion de date du format français (JJ/MM/AAAA) en Timestamp.
* @param string $date Date au format français (JJ/MM/AAAA)
* @return integer Timestamp en seconde
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> dateFR2Time<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$day</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$timestamp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$timestamp</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> dateFR2Time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'16/01/1987'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Affiche 537750000</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/dateFR2Time.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/17/fonction-php-date-francaise-vers-timestamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonction PHP &#8211; Date américaine vers timestamp</title>
		<link>http://www.julien-breux.com/2009/02/16/fonction-php-date-americaine-vers-timestamp/</link>
		<comments>http://www.julien-breux.com/2009/02/16/fonction-php-date-americaine-vers-timestamp/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 13:00:18 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonction]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=33</guid>
		<description><![CDATA[Description
Fonction de conversion de date du format américain (AAAA-MM-JJ) en Timestamp.
Source

&#60;?php
/**
* Fonction de conversion de date du format américain (AAAA-MM-JJ) en Timestamp.
* @param string $date Date au format américain (AAAA-MM-JJ)
* @return integer Timestamp en seconde
*/
function dateUS2Timestamp&#40;$date&#41;
&#123;
  list&#40;$year, $month, $day&#41; = explode&#40;'-', $date&#41;;
  $timestamp = mktime&#40;0, 0, 0, $month, $day, $year&#41;;
  return $timestamp;
&#125;
?&#62;

Exemple

&#60;?php
echo [...]]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction de conversion de date du format américain (AAAA-MM-JJ) en Timestamp.</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction de conversion de date du format américain (AAAA-MM-JJ) en Timestamp.
* @param string $date Date au format américain (AAAA-MM-JJ)
* @return integer Timestamp en seconde
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> dateUS2Timestamp<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$year</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$timestamp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$timestamp</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> dateUS2Timestamp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1987-01-16'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Affiche 537750000</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/dateUS2Time.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/16/fonction-php-date-americaine-vers-timestamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonction PHP &#8211; Date américaine vers date française</title>
		<link>http://www.julien-breux.com/2009/02/15/fonction-php-date-americaine-vers-date-francaise/</link>
		<comments>http://www.julien-breux.com/2009/02/15/fonction-php-date-americaine-vers-date-francaise/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 13:00:34 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonctions]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=26</guid>
		<description><![CDATA[Description
Fonction de conversion de date du format américain (AAAA-MM-JJ) vers le format français (JJ/MM/AAAA).
Très pratique lorsque vous voulez transformer une date en provenance de MySQL vers une date en français par exemple.
Source

&#60;?php
/**
* Fonction de conversion de date du format américain (AAAA-MM-JJ) vers le format français (JJ/MM/AAAA).
* @param string $date Date au format américain (AAAA-MM-JJ)
* @return [...]]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction de conversion de date du format américain (AAAA-MM-JJ) vers le format français (JJ/MM/AAAA).</p>
<p>Très pratique lorsque vous voulez transformer une date en provenance de MySQL vers une date en français par exemple.</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction de conversion de date du format américain (AAAA-MM-JJ) vers le format français (JJ/MM/AAAA).
* @param string $date Date au format américain (AAAA-MM-JJ)
* @return string Date au format français (JJ/MM/AAAA)
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> dateUS2FR<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_reverse</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$date</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> dateUS2FR<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1987-01-16'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Affiche 16/01/1987</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/dateUS2FR.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/15/fonction-php-date-americaine-vers-date-francaise/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fonction PHP &#8211; Date française vers date américaine</title>
		<link>http://www.julien-breux.com/2009/02/14/fonction-php-date-francaise-vers-date-americaine/</link>
		<comments>http://www.julien-breux.com/2009/02/14/fonction-php-date-francaise-vers-date-americaine/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 13:00:13 +0000</pubDate>
		<dc:creator>Julien</dc:creator>
				<category><![CDATA[Fonctions PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fonctions]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.julien-breux.com/?p=20</guid>
		<description><![CDATA[Description
Fonction de conversion de date du format français (JJ/MM/AAAA) vers le format américain (AAAA-MM-JJ).
Très pratique lorsque vous voulez transformer une date saisissable en français vers MySQL par exemple.
Source

&#60;?php
/**
* Fonction de conversion de date du format français (JJ/MM/AAAA) vers le format américain (AAAA-MM-JJ).
* @param string $date Date au format français (JJ/MM/AAAA)
* @return string Date au format [...]]]></description>
			<content:encoded><![CDATA[<h1>Description</h1>
<p>Fonction de conversion de date du format français (JJ/MM/AAAA) vers le format américain (AAAA-MM-JJ).</p>
<p>Très pratique lorsque vous voulez transformer une date saisissable en français vers MySQL par exemple.</p>
<h1>Source</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
* Fonction de conversion de date du format français (JJ/MM/AAAA) vers le format américain (AAAA-MM-JJ).
* @param string $date Date au format français (JJ/MM/AAAA)
* @return string Date au format américain (AAAA-MM-JJ)
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> dateFR2US<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_reverse</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$date</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Exemple</h1>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> dateFR2US<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'16/01/1987'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Affiche 1987-01-16 </span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h1>Source</h1>
<p><a href="/sources/dateUS2FR.phps">Télécharger la source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julien-breux.com/2009/02/14/fonction-php-date-francaise-vers-date-americaine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
