note 90094 modified in function.compact by danbrown
| From: | danbrown@php.net | Date: | Mon, 06 Apr 2009 16:11:10 +0000 |
| Subject: | note 90094 modified in function.compact by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152866@lists.php.net to get a copy of this message | ||
Compact does not work with references, but there is a short way to resolve this:
<?php
//$foo=array();
foreach( array('apple','banana') as $v) $foo[$v] = &$v;
?>
--was--
Compact does not work with references, but there is a short way to resolve this:
//$foo=array();
foreach( array('apple','banana') as $v) $foo[$v] = &$v;
http://php.net/manual/en/function.compact.php