note 6671 modified in array_values by jmcastagnetto

From: Date: Fri, 08 Sep 2000 18:15:27 +0000
Subject: note 6671 modified in array_values by jmcastagnetto
Groups: php.notes 
Request: Send a blank email to php-notes+get-4550@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> http://www.php.net/manual/function.array-values.php

« previous php.notes (#4550) next »