In this paper, a highly flexible synthesis method for an arbitrary array is proposed to best approximate a desired array pattern in a minimum-mean-square-error sense. The basic idea of the technique is to form a quadratic program with its cost function given by the mean-square error between the array response and a properly selected pattern described by a known mathematical function. This quadratic program can be a constrained or unconstrained optimization problem depending on the requirements of the desired array pattern. In formulating the quadratic program, no assumption has been made on the pin/phase response or characteristics of the individual array elements. Therefore, one can synthesize an array of arbitrary shape to any appropriate pattern with the characteristic of the array elements taken into consideration as long as one is able to model the array accurately. In this paper, the proposed method is used to synthesize arrays of different shapes, linear as well as planar arrays (including rectangular and circular planar arrays), using a Chebyshev polynomial or zero function as a design template, to illustrate the feasibility of the proposed method.