multi-dimensional arrays

From: Date: Mon, 13 Apr 2009 18:55:26 +0000
Subject: multi-dimensional arrays
Groups: php.general 
Request: Send a blank email to php-general+get-291440@lists.php.net to get a copy of this message
Hi, I am learning PHP and have a simple question. I have a input string in this form: xxx xxxx xx xxxxx xx xxx xx xxxxx x xxx xx xxxxxx
    .
    .
    .
xx xxx xx xxxx xx xx each line has 6 words of various lengths, all separated by white space. the input string can have any number of lines I want to put this into a multi-dimensional array, each line an array that is an element of an outer array. I have tried various ways to do this--I have used explode() and array_filter() and can get a single line parsed and into an array but I am having problems getting a well formed 2 dim array. What is the easiest way to do this? With all of the PHP array functions, there should be an very straight forward way to do this. Any help would be appreciated. -Andres

« previous php.general (#291440) next »