Jump to content

Die() And Txt


es131245

Recommended Posts

2 questions....die(" #Some wierd russian text # ");and when i open txt in browser likehttp://localhost/qwerty.txtif i use eng everything is good but for other languages how can i set encoding???Something like <meta http-equiv="content-type" content="text/html" charset="utf-8" />

Link to comment
Share on other sites

You can use the header() function, like:

header('Content-Type:text/plain;charset=utf-8');

Link to comment
Share on other sites

how can i attach heading to txt file or die() ?????
If in PHP, you place that function right before you die(), i.e.
header('Content-Type:text/plain;charset=utf-8');die(" #Some wierd russian text # ");

If in a txt file... you'll have to append the header with an .htaccess file, assuming you have mod_headers enabled and .htaccess rights to begin with.

Link to comment
Share on other sites

  • 2 months later...
but iffopen ('123.txt') or die('utf-8 sign');
Doesn't matter. If it's going out to the browser,
header('Content-Type:text/plain;charset=utf-8');

needs to be present beforehand.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...