make variables out of a string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lovelf
Forum Contributor
Posts: 153
Joined: Wed Nov 05, 2008 12:06 am

make variables out of a string

Post by lovelf »

Code: Select all

 
$variablex='hello world';
 
How to store 'hello' as one variable and 'world' as another? - considering the space is a separator.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: make variables out of a string

Post by requinix »

The easiest way would be to explode the string into tiny little bits. Figuratively.
Post Reply