How can the issue of only retrieving the first character or number from a string within an array be resolved in PHP, specifically in the context of the Teamspeak 3 PHP framework mentioned in the thread?

Issue: To retrieve the first character or number from a string within an array using the Teamspeak 3 PHP framework, you can use the substr function to extract the first character or number from each string in the array.

// Example code snippet to retrieve the first character or number from a string within an array
$array = ["abc", "123", "xyz"];

foreach ($array as $string) {
    $firstChar = substr($string, 0, 1);
    echo $firstChar . "\n";
}