Just a small question.
How can I, if possible (in a simple way), expode a variable consisting of one word, whereby I wish to store the letters in in an array?
I understand that you cannot have a NULL deliminator in the explode function, hence why i pose the question here.
thankyou in advance for any and all assistance.
weasel
Exploding !!!
Moderator: General Moderators
Re: Exploding !!!
I believe you can access each character as if it were an array already.
Just tested it, and it works.
Just tested it, and it works.
Code: Select all
$text = 'this is my string';
echo $text[0]; // returns t
- Weasel5-12
- Forum Commoner
- Posts: 37
- Joined: Tue Sep 16, 2008 6:58 am
Re: Exploding !!!
thankyou very much.
very much appreciated
very much appreciated
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: Exploding !!!
You can use the str_split() functionWeasel5-12 wrote:How can I, if possible (in a simple way), expode a variable consisting of one word, whereby I wish to store the letters in in an array?