PHP data types are supported by IBM® Integration Bus.
The following table shows the mappings between the ESQL and PHP data types:
| ESQL type | PHP type |
|---|---|
| INTEGER, INT |
|
| FLOAT | float |
| DECIMAL | Java™ BigDecimal |
| CHARACTER, CHAR | string |
| BLOB | MbsBlob |
| DATE | Java com.ibm.broker.plugin.MbDate |
| TIME, GMTIME | Java com.ibm.broker.plugin.MbTime |
| TIMESTAMP, GMTIMESTAMP | Java com.ibm.broker.plugin.MbTimestamp |
| INTERVAL | Not supported |
| BOOLEAN | Boolean |
| REFERENCE | MbsElement |
Some of the PHP types are mapped onto Java data types; for example, BigDecimal and MbTimestamp. You can manipulate these values by using the Java bridge. For more information, see Calling Java from PHP.
No 64-bit integer type exists in PHP, therefore large values are represented as a float. You can use the Java bridge to manipulate Java types. The INTERVAL ESQL type is not represented in the Java API for the broker.
PHP processes the values stored in a string data type as single-byte strings. However, PHP has a multibyte string extension that enables the manipulation of multibyte strings in a PHP string variable. This PHP extension is included with the PHPCompute node.
For
more information about PHP extensions, see the
PHP:
Hypertext Preprocessor website.
The following multibyte functions are provided with the PHPCompute node:
| Function | Description |
|---|---|
| mb_convert_encoding | Converts the character encoding of a string. |
| mb_decode_mimeheader | Decodes the encoded string in a MIME header. |
| mb_encode_mimeheader | Encodes a string with MIME header encoding. |
| mb_ereg | Runs the regular expression match with multibyte support. |
| mb_ereg_replace | Replaces the regular expression with multibyte support. |
| mb_internal_encoding | Sets or gets the internal character encoding. |
| mb_regex_encoding | Returns the current encoding for a multibyte regex as a string. |
| mb_regex_set_options | Sets the default options (specified by the options parameter) for multibyte regex functions. |
| mb_split | Splits a multibyte string and returns the result as an array. |
| mb_stripos | Finds the position of the first occurrence of a string within another. This function is not case sensitive. |
| mb_stristr | Finds the first occurrence of a string within another. This function is not case sensitive. |
| mb_strlen | Gets the length of a string. |
| mb_strpos | Finds the position of the first occurrence of a string in a string. |
| mb_strrchr | Finds the last occurrence of a character in a string within another string. |
| mb_strrichr | Finds the last occurrence of a character in a string within another string. This function is not case sensitive. |
| mb_strripos | Finds the position of the last occurrence of a string within another string. This function is not case sensitive. |
| mb_strrpos | Finds the position of the last occurrence of a string within a string. |
| mb_strstr | Finds the first occurrence of a string within another. |
| mb_strtolower | Makes a string lowercase. |
| mb_strtoupper | Makes a string uppercase. |
| mb_substitute_character | Sets or gets a substitution character. |
| mb_substr | Gets part of a string. |
| mb_substr_count | Counts the number of substring occurrences. |