Tab 1 number of buttons = 2 $VAR1 = [ { 'parent' => '-1', 'y_coordinate' => '5', 'x_coordinate' => '5', 'evt_1_function' => 'testclick', 'x_size' => '-1', 'evt_1' => 'EVT_BUTTON', 'internal_name' => 'test1', 'text' => 'button 1', 'y_size' => '-1' } ]; $VAR1 = [ { 'parent' => '-1', 'y_coordinate' => '50', 'x_coordinate' => '50', 'evt_1_function' => 'testclick2', 'x_size' => '-1', 'evt_1' => 'EVT_BUTTON', 'internal_name' => 'test2', 'text' => 'button 2', 'y_size' => '-1' } ]; Tab 2 number of buttons = 0