SommaireTelecharger la documentationChapitre suivantChapitre precedent  

  .: News :.: Edito :.: Scripts :.: Forum :.: Erreurs :.: Jobs :. 
 
Sommaire

Chaînes de caractères multi-octets

Introduction
mb_language
mb_parse_str
mb_internal_encoding
mb_http_input
mb_http_output
mb_detect_order
mb_substitute_character
mb_output_handler
mb_preferred_mime_name
mb_strlen
mb_strpos
mb_strrpos
mb_substr
mb_strcut
mb_strwidth
mb_strimwidth
mb_convert_encoding
mb_detect_encoding
mb_convert_kana
mb_encode_mimeheader
mb_decode_mimeheader
mb_convert_variables
mb_encode_numericentity
mb_decode_numericentity
mb_send_mail

6.51.18 mb_convert_encoding

[ Exemples avec mb_convert_encoding ]   PHP 4 >= 4.0.6

Description

string mb_convert_encoding(string str ,string to-encoding ,[mixed from-encoding ])

mb_convert_encoding convertit la chaîne str depuis l'encodage from-encoding vers l'encodage to-encoding.

str à convertir.

from-encoding est l'encodage de la chaîne str à l'origine. Il sera détecté parmi plusieurs encodage fournis sous forme d'un tableau, ou d'une liste d'encodages séparés par des virgules.

Exemple avec mb_convert_encoding

<?php
/* Convertit l'encodage interne vers SJIS */
$str mb_convert_encoding($str"SJIS");
/* Convertit EUC-JP en UTF-7 */
$str mb_convert_encoding($str"UTF-7""EUC-JP");
/* Détecte automatiquement un encodage entre JIS, eucjp-win ou sjis-win,
   Puis convertit en UCS-2LE */
$str mb_convert_encoding($str"UCS-2LE""JIS, eucjp-win, sjis-win");
/* "auto" signifie "ASCII,JIS,UTF-8,EUC-JP,SJIS" */
$str mb_convert_encoding($str"EUC-JP""auto");
?>

Voir aussi mb_detect_order.


Chapitre précédentChapitre suivantAccueil nexen.net