I would like to render a webpage like the pastebin.com does in a raw view mode. Here is an example on pastebin.com
http://pastebin.com/raw.php?i=VawEm8ge
if you look to the source code, there is no html code.
I tried in this way:
<pre style="word-wrap: break-word; white-space: pre-wrap;">
#EXTM3U
#EXTVLCOPT:udp-caching=1000
#EXTINF:-1, DUNA Televízió
http://212.40.98.166/intstreams/mtva/dunalive.smil/VID_854x480_HUN.m3u8
#EXTINF:-1 , Duna World
http://212.40.98.161/intstreams/mtva/dunaworldlive_international.smil/VID_854x480_HUN.m3u8
</pre>
But the output is not the same with the output from the pastebin.com
答案 0 :(得分:1)
It is because that page is not HTML. If you take a look at the response, the Content-Type
is text/plain; charset=utf-8
.
To do the same thing on your sever, you need to control the response header to set Content-Type
. For example:
header('Content-Type: text/plain');
Just set it before writing output.