note 6671 deleted from array_values by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Fri, 08 Sep 2000 18:22:25 +0000 |
| Subject: | note 6671 deleted from array_values by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4552@lists.php.net to get a copy of this message | ||
[Editor's note: The function proposed by scott@cyberwar.com below is not correct, as it assumes
that the array indexes are integers, a better solution for PHP3 would be:
function array_values ($arr) {
$t = array();
while (list($k,$v) = each($arr))
$t[] = $v;
return $t;
}
jmcastagnetto@php.net
]
Below is a function that I wrote that acts similar to array_values, but works in
PHP3:<br><br>
<pre>
function array_values ($x) {
for($i=0;$i<count($x);$i++) {
$y=each($x);
$z[$i]=$y[1];
}
return $z;
}
</pre>