mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-11 16:23:57 +02:00
Add meta charset in head
The HTTP Content-Type header has precedence but adding a meta charset in the head helps when opening an offline (e.g. downloaded) file in the browser. Also, note that the official character set name is in uppercase. See: http://www.iana.org/assignments/character-sets/character-sets.xhtml
This commit is contained in:
@@ -109,10 +109,11 @@ $handle->execute();
|
|||||||
// Store the result into an object that we'll output later in our HTML
|
// Store the result into an object that we'll output later in our HTML
|
||||||
$result = $handle->fetchAll(\PDO::FETCH_OBJ);
|
$result = $handle->fetchAll(\PDO::FETCH_OBJ);
|
||||||
|
|
||||||
header('Content-Type: text/html; charset=utf-8');
|
header('Content-Type: text/html; charset=UTF-8');
|
||||||
?><!doctype html>
|
?><!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
<title>UTF-8 test page</title>
|
<title>UTF-8 test page</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
Reference in New Issue
Block a user