-1

I can convert a string 'html php js' to array using explode, such as

$string = 'html php js';
$output_array = explode(' ', $string);

and it works fine. But how to convert a string that has no spaces?

$string = 'html';

// *** outputs as ['h','t','m','l']

and that the output has to be an array of strings.

first
  • 616
  • 1
  • 7
  • 13

1 Answers1

-1

Try to use the str_split function: https://www.php.net/manual/en/function.str-split.php