Re: string to array

From: Date: Fri, 08 Nov 2002 13:04:14 +0000
Subject: Re: string to array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-123368@lists.php.net to get a copy of this message
Quick and Dirty: <?php $string = 'hello how are you today'; $new_string = preg_split("/[\s]?/", $string); print_r($new_string); ?> Timothy Hitchens (HiTCHO) tim@hitcho.com.au If you need PHP hosting with an experienced support team 24/7 then email me today. On Fri, 8 Nov 2002, Marek Kilimajer wrote: > Hi all, > > has anyone an elegant (and faster) way of converting 'string' to > array('s','t','r','i','n','g'), > other then > for($i=0; $i<strlen($string); $i++) $array[$i]=$string[$i]; > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#123368) next »