jayelkaake

PHP Preserves Last Item in Foreach

Feb 16th, 2015
240
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     foreach($companies as $company) {
  2.         if(isset($app)) {
  3.             $apps = array($app);
  4.         } else {
  5.             $apps = $company->getAllApps();
  6.         }
  7.         foreach($apps as $app) {
  8.         // Do some stuff.
  9.         }
  10.     }
RAW Paste Data