Mailinglisten-Archive |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michael Borchers schrieb:
> Ich habe ein array users_time_sum_array in folg. form:
>
> Array
> (
> [3] => Array
> (
> [0] => 3.00
> [1] => 1.50
> )
>
> [22] => Array
> (
> [0] => 5.25
> [1] => 6.55
> [2] => 8.00
> [3] => 4.30
> )
> }
>
> nun lese ich jeden key aus und summiere dann die dazugehörigen zahlen, ungefähr so:
>
> while($users_id = current($users_time_sum_array)) {
> $users_id = key($users_time_sum_array);
> $users_time_sum = array_sum($users_time_sum_array[$users_id]);
> next($users_time_sum_array);
> }
> das funzt wunderbar, aber gibt es so noch irgendeine mögl. die die ausgabe in der while schleifenach
> $users_time_sum zu sortieren? gibt es ne lösung, die das könnte?danke
sieht komisch aus ... ;-)
foreach ($users_time_sum_array as $user_id => $user_times) {
$user_times[$user] = array_sum($user_times);
}
array_sort($user_times);
- --
Sebastian Mendel
www.sebastianmendel.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
iD8DBQFENRwOX/0lClpZDr4RAs/fAJ9lzJKoBThL5NSwalY2FgodqORzCgCgllFW
VdGQhYpKyyBJ+oJ1DPY19rQ=
=TaVF
-----END PGP SIGNATURE-----
php::bar PHP Wiki - Listenarchive