I am trying out the following
$x = "126·10⁴";
$array = str_split($x);
echo "x = " . $x . "<br>";
echo "Array length: " . count($array) . "<br>";
echo "Charset: " .mb_detect_encoding($x)."<br>";
foreach($array as $i)
echo $i . " ";
which gives as output:
x = 126·10⁴
Array length: 10
Charset: UTF-8
1 2 6 � � 1 0 � � �
I want the · and ⁴ to be 1 character in the array, how can this be done?
What I am trying to reach is to iterate over all characters of a string, so any other solution is also welcome.