Serialize an array