0

Can anyone help me? I want to convert a word to an array.

example:

$word = "hello"

and I want to convert it to an array like this:

$wordarray = ['h', 'e', 'l', 'l', 'o'];

The size of the array is automatically set by the length of the word

Is that possible?

Nick
  • 138,499
  • 22
  • 57
  • 95
Wisnu
  • 1
  • 1

1 Answers1

2

use str_split() like

str_split('hello');
Poonam Navapara
  • 186
  • 1
  • 9