charAt

Synopsis

$ charAt("string", n)

Returns the character at the n'th position in the string

Parameters

"string" - the string to extract the character value from.

n - the string position to extract the character from.

Returns

A scalar string containing a single character.

Examples

$string = "hello world"; for ($x = 0; $x < strlen($string); $x++) { print(charAt($string, $x) . " "); } println();

h e l l o w o r l d

See Also