PHP: Split string into array of chars
21 September 2024 (Updated 21 September 2024)
<?php
$name = 'John doe';
print_r(str_split($name));
Output:
Array
(
[0] => J
[1] => o
[2] => h
[3] => n
[4] =>
[5] => d
[6] => o
[7] => e
)
Tagged:
PHP