note 65883 rejected from function.array by nlopess
| From: | nlopess@php.net | Date: | Tue, 09 May 2006 20:50:45 +0000 |
| Subject: | note 65883 rejected from function.array by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-110966@lists.php.net to get a copy of this message | ||
Note Submitter: fourmi at lfi dot fr
----
Comment déclarer un tablo à 2 dimensions ?
settype ( $tablo , "array array") ? not good
$tablo = array( array() ) ? not good
Pourquoi avoir besoin de déclarer un tablo à 2 dimensions ?
parce qu'en faisant :
$tablo[1][1] = "truc";
..
$tablo[2][1] = "machin";
...
array_shift ($tablo[2]) sort un :
" PHP Warning: array_shift() The argument should be an array in ..."
Alors que c'est un tablo !! ( Ã une dimension)
le seul contournement trouvé est de déclarer en début :
$tablo[0] = array() !!!
Y-a-t-il une autre méthode ?