User Tools

Site Tools


uphp:functions:charat

charat

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Return the ASCII code for a character in a string at an index

Description

int charat ( string $str, int $index )

Parameters

$str: String to get character from

$index: Index into string (the first character in the string is index = 0)

Return Values

Integer ASCII code (0-255)

Example

<?
  $str="Test String";
  $ascii=charat($str,5);
  print($ascii); // result is 83
?>

See Also

ord() - Return the ASCII code for a character

chr() - Return the character for an ASCII code

uphp/functions/charat.txt · Last modified: 2021/09/13 05:57 (external edit)