<?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>The Troll&#039;s factory &#187; date de modification</title>
	<atom:link href="http://trollfactory.fr/tag/date-de-modification/feed" rel="self" type="application/rss+xml" />
	<link>http://trollfactory.fr</link>
	<description>Geekeries &#38; pensées</description>
	<lastBuildDate>Mon, 09 Jun 2014 19:43:25 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>[PHP] Date de dernière modification d&#8217;un fichier distant en HTTP</title>
		<link>http://trollfactory.fr/php-date-de-derniere-modification-dun-fichier-distant-en-http-165</link>
		<comments>http://trollfactory.fr/php-date-de-derniere-modification-dun-fichier-distant-en-http-165#comments</comments>
		<pubDate>Thu, 18 Feb 2010 06:35:01 +0000</pubDate>
		<dc:creator><![CDATA[Troll]]></dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[Scripts, astuces, dév. web]]></category>
		<category><![CDATA[date de modification]]></category>
		<category><![CDATA[distant]]></category>
		<category><![CDATA[filemtime]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://trollfactory.fr/?p=165</guid>
		<description><![CDATA[Cette source n&#8217;est pas de moi, cependant comme je ne suis pas sûr que tous les gens qui cherchent comment récupérer la date de dernière modification d&#8217;un fichier en utilisant le HTTP (fichier distant) arrivent facilement à trouver ce post (en anglais en plus) je vous mets la source ici. D&#8217;ailleurs, au passage, comme je [...]]]></description>
				<content:encoded><![CDATA[<p>Cette source n&rsquo;est pas de moi, cependant comme je ne suis pas sûr que tous les gens qui cherchent <strong>comment récupérer la date de dernière modification d&rsquo;un fichier en utilisant le HTTP (fichier distant)</strong> arrivent facilement à trouver <a href="http://www.php.net/manual/en/function.filemtime.php#73747">ce post (en anglais en plus)</a> je vous mets la source ici.</p>
<p>D&rsquo;ailleurs, au passage, comme je suis un gentil Troll, je vous l&rsquo;ai traduite <img src="//trollfactory.fr/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
<pre>
// Récupérer la date de dernière modification d'un fichier distant (la fonction retourne un timestamp unix, cf. http://wiki.pcinfo-web.com/timestamp )
function RecupDateModifDistant( $uri )
{
// default
$unixtime = 0;
$fp = fopen( $uri, "r" );
if( !$fp ) {return;}

$MetaData = stream_get_meta_data( $fp );

foreach( $MetaData['wrapper_data'] as $response )
{
// Dans le cas d'une redirection vers une autre page / un autre fichier
if( substr( strtolower($response), 0, 10 ) == 'location: ' )
{
$newUri = substr( $response, 10 );
fclose( $fp );
return RecupDateModifDistant( $newUri );
}
// Dans le cas où on a bien l'en-tête "last-modified"
elseif( substr( strtolower($response), 0, 15 ) == 'last-modified: ' )
{
$unixtime = strtotime( substr($response, 15) );
break;
}
}
fclose( $fp );
return $unixtime;
}
</pre>
<p>Voilà, pour toute demande d&rsquo;explication du code, les commentaires sont là pour ça, ils vous attendent pour vous faire des calins ! (gratuit !)</p>
Share and Enjoy:<a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a rel="nofollow" target="_blank"  href="http://twitter.com/home?status=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP%20-%20http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;t=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP&amp;source=The+Troll%26%23039%3Bs+factory+Geekeries+%26amp%3B+pens%C3%A9es&amp;summary=Cette%20source%20n%27est%20pas%20de%20moi%2C%20cependant%20comme%20je%20ne%20suis%20pas%20s%C3%BBr%20que%20tous%20les%20gens%20qui%20cherchent%20comment%20r%C3%A9cup%C3%A9rer%20la%20date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20en%20utilisant%20le%20HTTP%20%28fichier%20distant%29%20arrivent%20facilement%20%C3%A0%20trouver%20ce%20post%20%28en%20an" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow" target="_blank"  href="http://trollfactory.fr/feed" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a rel="nofollow" target="_blank"  href="http://www.wikio.fr/vote?url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio FR" alt="Wikio FR" /></a><a rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP&amp;bodytext=Cette%20source%20n%27est%20pas%20de%20moi%2C%20cependant%20comme%20je%20ne%20suis%20pas%20s%C3%BBr%20que%20tous%20les%20gens%20qui%20cherchent%20comment%20r%C3%A9cup%C3%A9rer%20la%20date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20en%20utilisant%20le%20HTTP%20%28fichier%20distant%29%20arrivent%20facilement%20%C3%A0%20trouver%20ce%20post%20%28en%20an" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP&amp;notes=Cette%20source%20n%27est%20pas%20de%20moi%2C%20cependant%20comme%20je%20ne%20suis%20pas%20s%C3%BBr%20que%20tous%20les%20gens%20qui%20cherchent%20comment%20r%C3%A9cup%C3%A9rer%20la%20date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20en%20utilisant%20le%20HTTP%20%28fichier%20distant%29%20arrivent%20facilement%20%C3%A0%20trouver%20ce%20post%20%28en%20an" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP&amp;annotation=Cette%20source%20n%27est%20pas%20de%20moi%2C%20cependant%20comme%20je%20ne%20suis%20pas%20s%C3%BBr%20que%20tous%20les%20gens%20qui%20cherchent%20comment%20r%C3%A9cup%C3%A9rer%20la%20date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20en%20utilisant%20le%20HTTP%20%28fichier%20distant%29%20arrivent%20facilement%20%C3%A0%20trouver%20ce%20post%20%28en%20an" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a rel="nofollow" target="_blank"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/sphinn.png" class="sociable-img sociable-hovers" title="Sphinn" alt="Sphinn" /></a><a rel="nofollow" target="_blank"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/mixx.png" class="sociable-img sociable-hovers" title="Mixx" alt="Mixx" /></a><a rel="nofollow" target="_blank" title="Add to favorites" href="#" onclick="AddToFavorites(); return false;"><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/addtofavorites.png" class="sociable-img sociable-hovers" title="Add to favorites" alt="Add to favorites" /></a><a rel="nofollow" target="_blank"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/live.png" class="sociable-img sociable-hovers" title="Live" alt="Live" /></a><a rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a rel="nofollow" target="_blank"  href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/scoopeo.png" class="sociable-img sociable-hovers" title="Scoopeo" alt="Scoopeo" /></a><a rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP&urllanguage=fr" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a rel="nofollow" target="_blank"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/identica.png" class="sociable-img sociable-hovers" title="Identi.ca" alt="Identi.ca" /></a><a rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;t=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;title=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Ftrollfactory.fr%2Fphp-date-de-derniere-modification-dun-fichier-distant-en-http-165&amp;submitHeadline=%5BPHP%5D%20Date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20distant%20en%20HTTP&amp;submitSummary=Cette%20source%20n%27est%20pas%20de%20moi%2C%20cependant%20comme%20je%20ne%20suis%20pas%20s%C3%BBr%20que%20tous%20les%20gens%20qui%20cherchent%20comment%20r%C3%A9cup%C3%A9rer%20la%20date%20de%20derni%C3%A8re%20modification%20d%27un%20fichier%20en%20utilisant%20le%20HTTP%20%28fichier%20distant%29%20arrivent%20facilement%20%C3%A0%20trouver%20ce%20post%20%28en%20an&amp;submitCategory=science&amp;submitAssetType=text" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://trollfactory.fr/php-date-de-derniere-modification-dun-fichier-distant-en-http-165/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
