Re: multi-dimensional arrays

From: Date: Mon, 13 Apr 2009 21:36:14 +0000
Subject: Re: multi-dimensional arrays
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-291448@lists.php.net to get a copy of this message
Nitsan Bin-Nun wrote:
$string = "xxx xxxx xx xxxxx xx xxx xxx xxxx xx xxxxx xx xxx"; $t = explode("\n", $string); foreach ($t as $k => $v) $t[$k] = explode(" ", $v); var_dump($t);
After assigning the string do $string = preg_replace('/\s+/',' ',$string); Then you should be able to do the two explodes.

« previous php.general (#291448) next »