I have a PHP script called :
http://cyber-flick.com/apiMorpho.php?method=getMorphoData&word=kot
That displays some data in p
Also note that setting a header to "text/plain"
will result in all html and php (in part) printing the characters on the screen as TEXT, not as HTML. So be aware of possible HTML not parsing when using text type plain
.
Using:
header('Content-type: text/html; charset=utf-8');
Can return HTML and PHP as well. Not just text.
You have to specify what encoding the data is. Either in meta or in headers
header('Content-Type: text/plain; charset=utf-8');
Try this way header('Content-Type: text/plain; charset=utf-8');
Html:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="x" content="xx" />
vs Php:
<?php header('Content-type: text/html; charset=ISO-8859-1'); ?>
<!DOCTYPE HTML>
<html>
<head>
<meta name="x" content="xx" />
PHP, by default, always returns the following header: "Content-Type: text/html" (notice no charset), therefore you must use
<?php header('Content-type: text/plain; charset=utf-8'); ?>
header('Content-type: text/plain; charset=utf-8');