Open GoogleCodeExporter opened 9 years ago
Sorry, I accidentally sent.
I suggest this method:
/**
* Function to create the response header
* @author Falci <falci@falci.me>
* @param string $charset Charset. For example: UTF-8, ISO-8859-1. Default: UTF-8
* @return bool False if the type is not known, true for all other cases
*/
function setHeader($charset="UTF-8"){
switch ($this->type) {
case "atom":
header("Content-type: application/atom+xml; charset=$charset");
break;
case "json":
header("Content-type: application/json; charset=$charset");
break;
case "xml":
header("Content-type: text/xml; charset=$charset");
break;
case "rss":
header("Content-type: application/rss+xml; charset=$charset");
break;
default:
return false;
break;
}
return true;
}
Original comment by falci....@gmail.com
on 23 Apr 2010 at 3:07
Original issue reported on code.google.com by
falci....@gmail.com
on 23 Apr 2010 at 2:53