code
This function returns the UNICODE character code of the character supplied.
Indirect parameter passing is disabled
1-2
No. | Type | Description |
---|---|---|
1 input |
string | input string Input string containing character to decode |
Opt. 2 input |
numeral | character position Character position, if a character other than the 1st character needs to be decoded. Negative indexing: Negative values count from right to left, e.g. -1 = last character. Default value: 0 |
Type | Description |
---|---|
numeral | character code >0: UNICODE character code |
echo( code( 'Café 4.0 €' ) ); // C
echo( code( 'Café 4.0 €', 3 ) ); // é
echo( code( 'Café 4.0 €', -1 ) ); // €
echo( code( 'Café 4.0 €', 99 ) ); // -1 (out of bounds)
echo( code( '𝄞' ) ); // Violin clef
echo( code( '' ) ); // 0 returned
67
233
8364
-1
119070
0