I have problems with strings similar to these that have accents In the Initial Word.
for example : (nesecito grabs the first letter of each word of that name.)
$string = 'Álvaro Álvarez';
$parts = explode(" ", $string);
foreach($parts as $part){
echo $part[0].'<br>';
}
I have this result for each letter: � �
if i use utf8_encode i have this as a result for each letter : Ã Ã but those are not the letters, the letters are Á Á
Here is an example of what I did.
The result I'm looking for is Á Á If someone can help me solve this dilemma, I will be grateful.