function ReadFile($filename)
	{
		$fh = fopen($filename, 'r');
		$theData = fread($fh, filesize($filename));
		fclose($fh);
		return $theData;
	}

Related posts:

  1. Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest
  2. Defining the Kwwika API
  3. Drag Drop bug in JQuery UI 1.5.3
  4. MSDN e-book and podcast
  5. JavaScript namespace utility
Tagged with:
 
  • http://webreflection.blogspot.com/ Andrea Giammarchi

    file_get_contents, which is binary content safe ( “rb” as fopen flag otherwise ) is the “evolution” and

    if(!function_exists('file_get_contents'))
    {
        function file_get_contents($s)
        {
            $r=fread($f=fopen($s,'rb'),filesize($s));
            fclose($f);
            return $r;
        }
    }
    

    the natural fallback for 5 years older PHP installations ;-)

    See you on Monday mate, so far we are apparently only two Web 2.0 developers in the list! Regards

Set your Twitter account name in your settings to use the TwitterBar Section.