note 12055 modified in function.array by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 13:57:14 +0000 |
| Subject: | note 12055 modified in function.array by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79889@lists.php.net to get a copy of this message | ||
Notice that you can also add arrays to other arrays with the $array[] "operator" while the
dimension doesn't matter.
Here's an example:
$x[w][x] = $y[y][z];
this will give you a 4dimensional assosiative array.
$x[][] = $y[][];
this will give you a 4dimensional non assosiative array.
So let me come to the point. This get interessting for shortening things up. For instance:
<?php
foreach ($lines as $line){
if(!trim($line)) continue;
$tds[] = explode("$delimiter",$line);
}
?>
--was--
Notice that you can also add arrays to other arrays with the $array[] "operator" while the
dimension doesn't matter.
Here's an example:
$x[w][x] = $y[y][z];
this will give you a 4dimensional assosiative array.
$x[][] = $y[][];
this will give you a 4dimensional non assosiative array.
So let me come to the point. This get interessting for shortening things up. For instance:
foreach ($lines as $line){
if(!trim($line)) continue;
$tds[] = explode("$delimiter",$line);
}
http://php.net/manual/en/function.array.php