Re: string to array

From: Date: Fri, 08 Nov 2002 13:47:35 +0000
Subject: Re: string to array
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-123375@lists.php.net to get a copy of this message
Hello, "Maxim Maletsky" <maxim@php.net> wrote: [snip] > As of actually converting it you could do that very loop and have an: > $atr_arr[] = $str[$i] in it, or, even more elegantly by using split() > function or "...chunk.." something function(), don't remember right now. [/snip] Perhaps, this would remind you... :) <?php $str = 'string'; $chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY); print_r($chars); ?> That was from the manual: http://www.php.net/manual/en/function.preg-split.php - E

« previous php.general (#123375) next »