I am trying to blow a string character by character, but I have problems with special characters. I am currently using the following function:
<?php
$input = "Comment ça va?";
$array_input = str_split($input, 1);
print_r($array_input);
?>
Here's the conclusion:
Array (
[0] => C [1] => o [2] => m [3] => m [4] => e
[5] => n [6] => t [7] => [8] => [9] =>
[10] => a [11] => [12] => v [13] => a [14] => ? )
I have the same problem with line break:
Input:
"Hé!
Oui?"
Conclusion:
Array ( [0] => H [1] => [2] => [3] => ! [4] =>
[5] => [6] => O [7] => u [8] => i [9] => ? )
Does anyone have a solution to this problem? Many thanks.
source
share