php - Video-IDs to array, array has zero entries -


i have code

edit: works now

$eigenesvideoid = array(); $eigenesvideotitel = array(); $eigenesvideotags = array(); $counter = 0; function printentirefeed($videofeed, $counter) {  global $eigenesvideoid;  global $eigenesvideotitel;  global $eigenesvideotags;  global $counter;  foreach($videofeed $videoentry)   {   if ($videoentry->isvideoprivate() != "1")   {     $eigenesvideoid[$counter] = $videoentry->getvideoid();     $eigenesvideotitel[$counter] = $videoentry->getvideotitle();     $eigenesvideotags[$counter] = implode(",", $videoentry->getvideotags());     $counter++;    }  }   try   {    $videofeed = $videofeed->getnextfeed();  }   catch (zend_gdata_app_exception $e)   {    return;  }   if ($videofeed) {    printentirefeed($videofeed, $counter);  } }  printentirefeed($videofeed, 1);  echo count($eigenesvideoid); 

should put each video not private array. array empty, count zero.

how change recursive function (or outer array variables) have arrays filled , them accessible afterwards.

to use $videofeed->getnextfeed(), think must have initial feed, first.

also, filling array variables inside function; use variables outside function , must declare them global inside function. otherwise local. (or pass them reference. or use return variable @ end of function , capture after each call.)


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -