I have this piece of code:
<?php
$letters='ñéáóúí';
$letters=$letters[1];
echo $letters;
?>
I want to print "ñ" or any other letter but I only print � instead, any tips?
I have this piece of code:
<?php
$letters='ñéáóúí';
$letters=$letters[1];
echo $letters;
?>
I want to print "ñ" or any other letter but I only print � instead, any tips?
You can use the mb_str_split() function provided by the PHP language to split
multibyte charactersstring into individual characters.Requires PHP 7 >= 7.4.0, PHP 8
Live Demo: https://3v4l.org/sG8nQ