"; # Create the new collections for ($i = 0; $i < $numcollections; $i++) { $newcollectionIDs[] = create_collection($collectionuser, $collectionname . "_split_" . ($i + 1)); echo "Created collection " . $collectionname . "_split_" . ($i + 1) . "
"; } $currentcollection = 0; # Loop through the new collections adding one resource at a time for ($x = 0; $x < $countresources; $x++) { add_resource_to_collection($collectionresources[$x], $newcollectionIDs[$currentcollection]); $currentcollection++; if ($currentcollection >= $numcollections) { $currentcollection = 0; } }