Php <<< operator
<?php// IE - 200 OK
// Chrome - text/plain, 200 OK
// FF - application/rss+xml, 200 OK
header("Content-Type: application/rss+xml");
// IE - 200 Ok
// Chrome - application/rss+xml, 200 OK
// FF - text/html, 200 OK
//header("Content-Type: text/xml");
// be careful with the end 'RSS;', or will get 500 Error
// 1. no space before or after it, like ' RSS;' or 'RSS; '
// 2. must add a new line after it
echo $xmlstr = <<<RSS
<?xml version="1.0"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>x</title>
<link>x</link>
<description>x</description>
<language>x</language>
<copyright>x</copyright>
<generator>x</generator>
<managingEditor>x</managingEditor>
<webMaster>x</webMaster>
<ttl>0</ttl>
<item>
<title>Bringing Cutting-Edge Skills to Philippines Public Schools</title>
<link>http://www.austraining.com.au/newsandstories/120</link>
<description>Imagine teaching a computer class with fifty-five (55) students sharing about ten almost obsolete computers. While to others this herculean task might sound impossible, this is a usual daily routine for Anwar, a high school teacher in a public school nestled in a disadvantaged community in southern Philippines.</description>
<pubDate>Thu, 10 Jun 2010 12:00:00 GMT</pubDate>
<media:thumbnail url="http://www.xxx.com.au/rssfeeds/attachments/view/anwar.jpg" width="144" height="108" time="16:37:27" />
</item>
</channel>
</rss>
RSS;
// there must be a new line after it, can't delete this line
页:
[1]