I don't get it.
First off, i don't understand that function at all. It's completely unnescecary, because
PHP Code:
$text='23V45';
$string=$text{3};
would give me exacly the same, without needing the function to first turn the string into an array of 1 character elements.
Then i don't understand how all this gets you the first letter.
I mean you here hardcode the position.
In fact, it is wrong, because $string[3] will return '6' because it's a zero based array.
I thought you wanted to dynamically get the first letter from any string, or is it always the third character?
Anyway, the dynamic version would be something like:
PHP Code:
$text = "23V6";
for ($i = 0; $i < strlen($text); $i++) {
if (eregi("[a-z]", $text{$i})) {
$string = $text{$i};
break();
}
}