small php script used in drupal module not clear with arrays in php Here is a small PHP code which I am not clear with.

/**
* Form for configurable Drupal action to beep multiple times
*/
function beep_multiple_beep_action_form($context) {
$form['beeps'] = array(
'#type' =&gt; 'textfield',
'#title' =&gt; t('Number of beeps'),
'#description' =&gt; t('Enter the number of times to beep when this action executes'),
'#default_value' =&gt; isset($context['beeps']) ? $context['beeps'] : '1',
'#required' =&gt; TRUE,
);
return $form;
}


In the above user defined function return $form what does it return? How do you access the individual elements of $form['beeps'] what is the significance of writing word beeps in square braces in $form['beeps']

function beep_multiple_beep_action_validate($form, $form_state) {
        $beeps = $form_state['values']['beeps'];
        if (!is_int($beeps)) {
        form_set_error('beeps', t('Please enter a whole number between 0 and 10.'));
        }
        else if ((int) $beeps &gt; 10 ) {
        form_set_error('beeps', t('That would be too annoying. Please choose fewer than 10
        beeps.'));
        } else if ((int) $beeps &lt; 0) {
        form_set_error('beeps', t('That would likely create a black hole! Beeps must be a
        positive integer.'));
        }
}


In above code what is 

$beeps = $form_state['values']['beeps'];


line doing?
In your first section of code, that function is creating a form using Drupal's Form API and $form['beeps'] contains the settings for a single form element, in this case a textfield.  

The second function is the one is used to validate the form values and will display an error for any unacceptable value.

$beeps = $form_state['values']['beeps'] fills the variable $beeps with the value of the "beeps" textfield from the form generated in the first function.