recode_string

(PHP 4, PHP 5, PHP 7 < 7.4.0)

recode_stringRecode a string according to a recode request

說明

recode_string(string $request, string $string): string

Recode the string string according to the recode request request.

參數

request

The desired recode request type

string

The string to be recoded

返回值

Returns the recoded string or false, if unable to perform the recode request.

范例

示例 #1 Basic recode_string() example

<?php
echo recode_string("us..flat""The following character has a diacritical mark: á");
?>

注釋

A simple recode request may be "lat1..iso646-de".

參見

  • The GNU Recode documentation of your installation for detailed instructions about recode requests.
  • mb_convert_encoding() - 轉換字符的編碼
  • UConverter::transcode() - Convert a string from one character encoding to another
  • iconv() - 字符串按要求的字符編碼來轉換