2. Variables whose value can be modified
Prev | Chapter 8. Global variables | Next

## 2. Variables whose value can be modified

### 2.1. xmlrpc_defencoding

`$xmlrpc_defencoding = "UTF8";`

This variable defines the character set encoding that will be used by the xml-rpc client and server to decode the received messages, when a specific charset declaration is not found (in the messages sent non-ascii chars are always encoded using character references, so that the produced xml is valid regardless of the charset encoding assumed).

Allowed values: `"UTF8"`, `"ISO-8859-1"`, `"ASCII".`

Note that the appropriate RFC actually mandates that XML received over HTTP without indication of charset encoding be treated as US-ASCII, but many servers and clients 'in the wild' violate the standard, and assume the default encoding is UTF-8.

### 2.2. xmlrpc_internalencoding

`$xmlrpc_internalencoding = "ISO-8859-1";`This variable defines the character set encoding that the library uses to transparently encode into valid XML the xml-rpc values created by the user and to re-encode the received xml-rpc values when it passes them to the PHP application. It only affects xml-rpc values of string type. It is a separate value from xmlrpc_defencoding, allowing e.g. to send/receive xml messages encoded on-the-wire in US-ASCII and process them as UTF-8. It defaults to the character set used internally by PHP (unless you are running an MBString-enabled installation), so you should change it only in special situations, if e.g. the string values exchanged in the xml-rpc messages are directly inserted into / fetched from a database configured to return UTF8 encoded strings to PHP. Example usage:

    <?php

    include('xmlrpc.inc');
    $xmlrpc_internalencoding = 'UTF-8'; // this has to be set after the inclusion above
    $v = new xmlrpcval('Îºá½¹ÏƒÎ¼Îµ'); // This xmlrpc value will be correctly serialized as the greek word 'kosme'

### 2.3. xmlrpcName

`$xmlrpcName = "XML-RPC for PHP";`The string representation of the name of the XML-RPC for PHP library. It is used by the client for building the User-Agent HTTP header that is sent with every request to the server. You can change its value if you need to customize the User-Agent string.

### 2.4. xmlrpcVersion

`$xmlrpcVersion = "2.2";`The string representation of the version number of the XML-RPC for PHP library in use. It is used by the client for building the User-Agent HTTP header that is sent with every request to the server. You can change its value if you need to customize the User-Agent string.

### 2.5. xmlrpc_null_extension

When set to `TRUE`, the lib will enable support for the <NIL/> xmlrpc value, as per the extension to the standard proposed here. This means that <NIL/> tags will be parsed as valid xmlrpc, and the corresponding xmlrpcvals will return "null" for `scalarTyp()`.

Prev | Up | Next
1. "Constant" variables | Home | Chapter 9. Helper functions