Ressources dev:PHP
(Différences entre les versions)
(→Encoder en UTF-8) |
(→Encoder en UTF-8) |
||
Ligne 4 : | Ligne 4 : | ||
1 - Modifier l’en-tête HTML | 1 - Modifier l’en-tête HTML | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="html4strict"> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> | <html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> |
Version du 27 décembre 2011 à 18:13
Intro
Encoder en UTF-8
1 - Modifier l’en-tête HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>…</title> </head>
2- Modifier l’encodage des fichiers avec NotePad++
3- Modifier l’encodage au niveau des tables dans PhpMyAdmin
4- Juste en dessous de la connexino MySql ajouter
$this->mysqli->query("SET NAMES 'utf8'") or die ('error');
Sous titre 2
blablablabla
<?php $v = "string"; // sample initialization ?> html text <? echo $v; // end of php code ?>