php添加到数组x次

I have modified a dimensions/shipping calculator and almost got it working as i require except i have hit a hurdle that i can not find a solution too.

what I need is to pass

 $b->add_inner_box($inner_L,$inner_W,$inner_D);

x number of times (set buy a cycle value and $count loop)

this is passed to

public function add_inner_box($l,$w,$h) {
    if ($l > 0 && $w > 0 && $h > 0) {
        $this -> inner_boxes[] = array(
            "dimensions" => $this -> sort_dimensions($l,$w,$h),
            "packed" => false
        );
    }
    return true;
}

I have looked at arr.push and other options but don`t think these will work in my situation, as you can probably tell i am a novice and could do with some guidance as to add the $b->add_inner_box to the array x times

if I use

$b->add_inner_box($inner_L,$inner_W,$inner_D);
$b->add_inner_box($inner_L,$inner_W,$inner_D);
$b->add_inner_box($inner_L,$inner_W,$inner_D);

within the script it works but this will not work in my aplication.