Posted by Oli Filth on 09/14/05 19:41
Steee said the following on 14/09/2005 16:38:
> is there a function like explode which breaks up a single word into an
> array?
>
> $word = "single";
>
> to
>
> $word[0] = "s";
>
> $word[1] = "i";
>
> $word[2] = "n";
>
> etc
Ummm:
$word = "single";
echo $word[0] . " " . $word[1] . " " . $word[2];
Although, this isn't a proper array.
Use str_split() if you want it to act as an array in other ways, e.g.
usable in foreach, and array functions.
--
Oli
Navigation:
[Reply to this message]
|