Abstract-In this paper, a novel stochastic approach, i.e., the electromagnetism-like (EM-like) algorithm, is applied to phase-only syntheses of antenna arrays. The goal is to minimize the pattern sidelobe under null-steering constraints by phase-only adjusting. The mechanism of EM-like algorithm results from the Coulomb's Law of Electromagnetics. It does not require gradient calculations, and can automatically converge at a good solution through the virtual charge of each particle. Simulation results show that the EM-like algorithm can well treat the phase-only optimization of antenna arrays. Although the null-steering constraints will affect the optimization in sidelobe reduction, it can be easily included in the EM-like based optimization scheme. The EM-like algorithm can be applied not only to problems of antenna arrays, but also to many other nonlinear optimization problems in electromagnetic waves.