I think what you’ve run in to there is that PHP treats strings as arrays, even if they’re not arrays. So when you
$absent = $result[0];
you actually take the first character of the string which is $result, in this case a 9. $result isn’t an array, because it’s the result of your implode() call. So you’re getting a character from a string, not an element of an array.