<button id="animals" type="button" value="push" >Push</button>
$animalArray = array($dog, $cat, $horse, $lamb, $fox);
// here comes the array push something like this
You have to write a server side script with PHP (that handles the content of your array) which is then called via Ajax from within your jQuery code (on the client side). It is not possible to do this in a single script either on client side nor on server side.