This code was a little confusing to me.  It uses a foreach loop to iterate over an indexed array rather than an associative array, additionally using $key as the variable.  I would suggest using a for loop instead:

    for ( $i = 0; $i < count($formValues['displayTitle']); $i++) {

or just change $key to something like $index so its clear.