recode_file

Recode from file to file according to recode request

说明

bool recode_file ( string $request , resource $input , resource $output )

Recode the file referenced by file handle input into the file referenced by file handle output according to the recode request.

参数

request
The desired recode request type

input
A local file handle resource for the input

output
A local file handle resource for the output

返回值

Returns FALSE, if unable to comply, TRUE otherwise.

范例

示例 #1 Basic recode_file example

<?php
$input = fopen('input.txt', 'r');
$output = fopen('output.txt', 'w');
recode_file("us..flat", $input, $output);
?>

注释

This function does not currently process file handles referencing remote files (URLs). Both file handles must refer to local files.

参见

  • fopen

recode_string

Recode a string according to a recode request

说明

string recode_string ( string $request , 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.

recode

别名 recode_string

说明

此函数是该函数的别名: recode_string.

目录

  • recode_file — Recode from file to file according to recode request
  • recode_string — Recode a string according to a recode request
  • recode — 别名 recode_string