Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Tablica dynamiczne wymiary
-poprzednik-
post
Post #1





Goście







Kod:
  1. $tasksout = array();
  2. $tasksout['counthours'] = 0;
  3. foreach($tasks as $task){
  4. $user = $userManager->findUserBy(array('id' => $task->getUserId()));
  5. $tasksout[$task->getid()]['task_id'] = $task->getTaskid();
  6. $tasksout[$task->getid()]['username'] = $user->getUsername();
  7. $tasksout[$task->getid()]['userid'] = $task->getUserId();
  8. $tasksout[$task->getid()]['hours'] = $task->gethours();
  9. $tasksout['countperuser'][$task->getUserId()] += $task->gethours();
  10. $tasksout['counthours'] += $task->gethours();
  11. }

notacja która zwraca internala:
Notice: Undefined offset:(tu liczba zależna od [$task->getUserId())
Chodzi o tą linię:
  1. $tasksout['countperuser'][$task->getUserId()] += $task->gethours();


Jak się pozbyć tej notacji i zrobić by banglało?
Go to the top of the page
+Quote Post

Posty w temacie
- poprzednik   [PHP]Tablica dynamiczne wymiary   3.04.2014, 09:46:57
- - trueblue   [PHP] pobierz, plaintext if(!isset($taskso...   3.04.2014, 09:49:05


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 14:10