first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

PHP Code: A REST Call Using readfile(); WARNING: Mysterious "Cannot modify header information" Warnings in UTF-8 Encoded Documents

The following uses the readfile() function to load an XML file. This pattern can be used for AJAX calls outside of the security sandbox:

header('Content-type:text/xml');
/*
    WARNING:
    Do not include a Unicode Signature or
    Byte-order Mark (BOM) in this UTF8-encoded document.
    Doing so should generate "Cannot modify
    header information..." warnings in PHP.
*/
$uri = $_GET['uri'];
@readfile($uri);
mod date: 2005-11-15T00:54:11.000Z