<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PHP- Check If File Exists On Different Domain</title>
	<atom:link href="http://www.brightcherry.co.uk/scribbles/php-check-if-file-exists-on-different-domain/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brightcherry.co.uk/scribbles/php-check-if-file-exists-on-different-domain/</link>
	<description></description>
	<lastBuildDate>Wed, 16 May 2012 09:42:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Ian.J.Gough</title>
		<link>http://www.brightcherry.co.uk/scribbles/php-check-if-file-exists-on-different-domain/#comment-2269</link>
		<dc:creator>Ian.J.Gough</dc:creator>
		<pubDate>Fri, 15 Jul 2011 12:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=97#comment-2269</guid>
		<description>Thats a lot quicker way to do it.
Many Thanks,
Ian</description>
		<content:encoded><![CDATA[<p>Thats a lot quicker way to do it.<br />
Many Thanks,<br />
Ian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: IdontKnow</title>
		<link>http://www.brightcherry.co.uk/scribbles/php-check-if-file-exists-on-different-domain/#comment-1325</link>
		<dc:creator>IdontKnow</dc:creator>
		<pubDate>Fri, 04 Mar 2011 23:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=97#comment-1325</guid>
		<description>http://curl.haxx.se/download.html
Place curl.exe in apache/bin/, enable php curl extension in php.ini and I think php must be registered as a apache module otherwise curl.exe must be placed in windows/system32/.

function rfile_exists($address)
{
	$ch = curl_init();
		
	curl_setopt($ch,CURLOPT_URL,$address);
	curl_setopt($ch,CURLOPT_NOBODY,1);
	curl_setopt($ch,CURLOPT_FAILONERROR,1);
	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);

	if(curl_exec($ch) !== FALSE)
	{
		return true;
	}
		
	return false;

curl_close($ch);
}</description>
		<content:encoded><![CDATA[<p><a href="http://curl.haxx.se/download.html" rel="nofollow">http://curl.haxx.se/download.html</a><br />
Place curl.exe in apache/bin/, enable php curl extension in php.ini and I think php must be registered as a apache module otherwise curl.exe must be placed in windows/system32/.</p>
<p>function rfile_exists($address)<br />
{<br />
	$ch = curl_init();</p>
<p>	curl_setopt($ch,CURLOPT_URL,$address);<br />
	curl_setopt($ch,CURLOPT_NOBODY,1);<br />
	curl_setopt($ch,CURLOPT_FAILONERROR,1);<br />
	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);</p>
<p>	if(curl_exec($ch) !== FALSE)<br />
	{<br />
		return true;<br />
	}</p>
<p>	return false;</p>
<p>curl_close($ch);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Igor PortalPressDOTorg</title>
		<link>http://www.brightcherry.co.uk/scribbles/php-check-if-file-exists-on-different-domain/#comment-1265</link>
		<dc:creator>Igor PortalPressDOTorg</dc:creator>
		<pubDate>Mon, 24 Jan 2011 19:44:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=97#comment-1265</guid>
		<description>Another example :

It took 0.338297 seconds to check http_get_headers [!]

It took 0.006532 seconds to check http_fsockopen on the same file.

I&#039;ve done this test over and over again, as I want the best performance. There are examples on the internet, how to make this function; they are, however, never as good as mine; but mine is commercial, so I can&#039;t give that away. Just keep in mind one tip : Never use preg_match!

Regards, Igor</description>
		<content:encoded><![CDATA[<p>Another example :</p>
<p>It took 0.338297 seconds to check http_get_headers [!]</p>
<p>It took 0.006532 seconds to check http_fsockopen on the same file.</p>
<p>I&#8217;ve done this test over and over again, as I want the best performance. There are examples on the internet, how to make this function; they are, however, never as good as mine; but mine is commercial, so I can&#8217;t give that away. Just keep in mind one tip : Never use preg_match!</p>
<p>Regards, Igor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Igor PortalPressDOTorg</title>
		<link>http://www.brightcherry.co.uk/scribbles/php-check-if-file-exists-on-different-domain/#comment-1264</link>
		<dc:creator>Igor PortalPressDOTorg</dc:creator>
		<pubDate>Mon, 24 Jan 2011 19:30:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=97#comment-1264</guid>
		<description>@Steve file_get_contents on a remote file is unreliable; after a while it might give errors. Just check the internet on what I assume. Besides that, Paul is right; why read a whole file? Your solution is not good and surely not the best. Pauls is a far better one.

However, I&#039;ve written a much larger function with fsockopen then Pauls, but the performance is also much better:

It took 0.003989 seconds to check http_get_headers, using Pauls function.
bool(true)=the result

It took 0.002345 seconds to check http_fsockopen, using my function.
bool(true)=the result 

Just a tip.

Regards, Igor</description>
		<content:encoded><![CDATA[<p>@Steve file_get_contents on a remote file is unreliable; after a while it might give errors. Just check the internet on what I assume. Besides that, Paul is right; why read a whole file? Your solution is not good and surely not the best. Pauls is a far better one.</p>
<p>However, I&#8217;ve written a much larger function with fsockopen then Pauls, but the performance is also much better:</p>
<p>It took 0.003989 seconds to check http_get_headers, using Pauls function.<br />
bool(true)=the result</p>
<p>It took 0.002345 seconds to check http_fsockopen, using my function.<br />
bool(true)=the result </p>
<p>Just a tip.</p>
<p>Regards, Igor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maruf</title>
		<link>http://www.brightcherry.co.uk/scribbles/php-check-if-file-exists-on-different-domain/#comment-1018</link>
		<dc:creator>Maruf</dc:creator>
		<pubDate>Mon, 28 Jun 2010 13:53:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=97#comment-1018</guid>
		<description>Hey Paul,

Many thanks, that&#039;s a great solution! I will update this post later :)

Learn something new every day...</description>
		<content:encoded><![CDATA[<p>Hey Paul,</p>
<p>Many thanks, that&#8217;s a great solution! I will update this post later <img src='http://www.brightcherry.co.uk/scribbles/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Learn something new every day&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

